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

import qualified Amazonka.Core as Core
import Amazonka.DataExchange.Types.AssetDestinationEntry
import Amazonka.DataExchange.Types.ExportServerSideEncryption
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Details of the operation to be performed by the job.
--
-- /See:/ 'newExportAssetsToS3RequestDetails' smart constructor.
data ExportAssetsToS3RequestDetails = ExportAssetsToS3RequestDetails'
  { -- | Encryption configuration for the export job.
    ExportAssetsToS3RequestDetails -> Maybe ExportServerSideEncryption
encryption :: Prelude.Maybe ExportServerSideEncryption,
    -- | The destination for the asset.
    ExportAssetsToS3RequestDetails -> [AssetDestinationEntry]
assetDestinations :: [AssetDestinationEntry],
    -- | The unique identifier for the data set associated with this export job.
    ExportAssetsToS3RequestDetails -> Text
dataSetId :: Prelude.Text,
    -- | The unique identifier for the revision associated with this export
    -- request.
    ExportAssetsToS3RequestDetails -> Text
revisionId :: Prelude.Text
  }
  deriving (ExportAssetsToS3RequestDetails
-> ExportAssetsToS3RequestDetails -> Bool
(ExportAssetsToS3RequestDetails
 -> ExportAssetsToS3RequestDetails -> Bool)
-> (ExportAssetsToS3RequestDetails
    -> ExportAssetsToS3RequestDetails -> Bool)
-> Eq ExportAssetsToS3RequestDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportAssetsToS3RequestDetails
-> ExportAssetsToS3RequestDetails -> Bool
$c/= :: ExportAssetsToS3RequestDetails
-> ExportAssetsToS3RequestDetails -> Bool
== :: ExportAssetsToS3RequestDetails
-> ExportAssetsToS3RequestDetails -> Bool
$c== :: ExportAssetsToS3RequestDetails
-> ExportAssetsToS3RequestDetails -> Bool
Prelude.Eq, ReadPrec [ExportAssetsToS3RequestDetails]
ReadPrec ExportAssetsToS3RequestDetails
Int -> ReadS ExportAssetsToS3RequestDetails
ReadS [ExportAssetsToS3RequestDetails]
(Int -> ReadS ExportAssetsToS3RequestDetails)
-> ReadS [ExportAssetsToS3RequestDetails]
-> ReadPrec ExportAssetsToS3RequestDetails
-> ReadPrec [ExportAssetsToS3RequestDetails]
-> Read ExportAssetsToS3RequestDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportAssetsToS3RequestDetails]
$creadListPrec :: ReadPrec [ExportAssetsToS3RequestDetails]
readPrec :: ReadPrec ExportAssetsToS3RequestDetails
$creadPrec :: ReadPrec ExportAssetsToS3RequestDetails
readList :: ReadS [ExportAssetsToS3RequestDetails]
$creadList :: ReadS [ExportAssetsToS3RequestDetails]
readsPrec :: Int -> ReadS ExportAssetsToS3RequestDetails
$creadsPrec :: Int -> ReadS ExportAssetsToS3RequestDetails
Prelude.Read, Int -> ExportAssetsToS3RequestDetails -> ShowS
[ExportAssetsToS3RequestDetails] -> ShowS
ExportAssetsToS3RequestDetails -> String
(Int -> ExportAssetsToS3RequestDetails -> ShowS)
-> (ExportAssetsToS3RequestDetails -> String)
-> ([ExportAssetsToS3RequestDetails] -> ShowS)
-> Show ExportAssetsToS3RequestDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportAssetsToS3RequestDetails] -> ShowS
$cshowList :: [ExportAssetsToS3RequestDetails] -> ShowS
show :: ExportAssetsToS3RequestDetails -> String
$cshow :: ExportAssetsToS3RequestDetails -> String
showsPrec :: Int -> ExportAssetsToS3RequestDetails -> ShowS
$cshowsPrec :: Int -> ExportAssetsToS3RequestDetails -> ShowS
Prelude.Show, (forall x.
 ExportAssetsToS3RequestDetails
 -> Rep ExportAssetsToS3RequestDetails x)
-> (forall x.
    Rep ExportAssetsToS3RequestDetails x
    -> ExportAssetsToS3RequestDetails)
-> Generic ExportAssetsToS3RequestDetails
forall x.
Rep ExportAssetsToS3RequestDetails x
-> ExportAssetsToS3RequestDetails
forall x.
ExportAssetsToS3RequestDetails
-> Rep ExportAssetsToS3RequestDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportAssetsToS3RequestDetails x
-> ExportAssetsToS3RequestDetails
$cfrom :: forall x.
ExportAssetsToS3RequestDetails
-> Rep ExportAssetsToS3RequestDetails x
Prelude.Generic)

-- |
-- Create a value of 'ExportAssetsToS3RequestDetails' 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:
--
-- 'encryption', 'exportAssetsToS3RequestDetails_encryption' - Encryption configuration for the export job.
--
-- 'assetDestinations', 'exportAssetsToS3RequestDetails_assetDestinations' - The destination for the asset.
--
-- 'dataSetId', 'exportAssetsToS3RequestDetails_dataSetId' - The unique identifier for the data set associated with this export job.
--
-- 'revisionId', 'exportAssetsToS3RequestDetails_revisionId' - The unique identifier for the revision associated with this export
-- request.
newExportAssetsToS3RequestDetails ::
  -- | 'dataSetId'
  Prelude.Text ->
  -- | 'revisionId'
  Prelude.Text ->
  ExportAssetsToS3RequestDetails
newExportAssetsToS3RequestDetails :: Text -> Text -> ExportAssetsToS3RequestDetails
newExportAssetsToS3RequestDetails
  Text
pDataSetId_
  Text
pRevisionId_ =
    ExportAssetsToS3RequestDetails' :: Maybe ExportServerSideEncryption
-> [AssetDestinationEntry]
-> Text
-> Text
-> ExportAssetsToS3RequestDetails
ExportAssetsToS3RequestDetails'
      { $sel:encryption:ExportAssetsToS3RequestDetails' :: Maybe ExportServerSideEncryption
encryption =
          Maybe ExportServerSideEncryption
forall a. Maybe a
Prelude.Nothing,
        $sel:assetDestinations:ExportAssetsToS3RequestDetails' :: [AssetDestinationEntry]
assetDestinations = [AssetDestinationEntry]
forall a. Monoid a => a
Prelude.mempty,
        $sel:dataSetId:ExportAssetsToS3RequestDetails' :: Text
dataSetId = Text
pDataSetId_,
        $sel:revisionId:ExportAssetsToS3RequestDetails' :: Text
revisionId = Text
pRevisionId_
      }

-- | Encryption configuration for the export job.
exportAssetsToS3RequestDetails_encryption :: Lens.Lens' ExportAssetsToS3RequestDetails (Prelude.Maybe ExportServerSideEncryption)
exportAssetsToS3RequestDetails_encryption :: (Maybe ExportServerSideEncryption
 -> f (Maybe ExportServerSideEncryption))
-> ExportAssetsToS3RequestDetails
-> f ExportAssetsToS3RequestDetails
exportAssetsToS3RequestDetails_encryption = (ExportAssetsToS3RequestDetails
 -> Maybe ExportServerSideEncryption)
-> (ExportAssetsToS3RequestDetails
    -> Maybe ExportServerSideEncryption
    -> ExportAssetsToS3RequestDetails)
-> Lens
     ExportAssetsToS3RequestDetails
     ExportAssetsToS3RequestDetails
     (Maybe ExportServerSideEncryption)
     (Maybe ExportServerSideEncryption)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportAssetsToS3RequestDetails' {Maybe ExportServerSideEncryption
encryption :: Maybe ExportServerSideEncryption
$sel:encryption:ExportAssetsToS3RequestDetails' :: ExportAssetsToS3RequestDetails -> Maybe ExportServerSideEncryption
encryption} -> Maybe ExportServerSideEncryption
encryption) (\s :: ExportAssetsToS3RequestDetails
s@ExportAssetsToS3RequestDetails' {} Maybe ExportServerSideEncryption
a -> ExportAssetsToS3RequestDetails
s {$sel:encryption:ExportAssetsToS3RequestDetails' :: Maybe ExportServerSideEncryption
encryption = Maybe ExportServerSideEncryption
a} :: ExportAssetsToS3RequestDetails)

-- | The destination for the asset.
exportAssetsToS3RequestDetails_assetDestinations :: Lens.Lens' ExportAssetsToS3RequestDetails [AssetDestinationEntry]
exportAssetsToS3RequestDetails_assetDestinations :: ([AssetDestinationEntry] -> f [AssetDestinationEntry])
-> ExportAssetsToS3RequestDetails
-> f ExportAssetsToS3RequestDetails
exportAssetsToS3RequestDetails_assetDestinations = (ExportAssetsToS3RequestDetails -> [AssetDestinationEntry])
-> (ExportAssetsToS3RequestDetails
    -> [AssetDestinationEntry] -> ExportAssetsToS3RequestDetails)
-> Lens
     ExportAssetsToS3RequestDetails
     ExportAssetsToS3RequestDetails
     [AssetDestinationEntry]
     [AssetDestinationEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportAssetsToS3RequestDetails' {[AssetDestinationEntry]
assetDestinations :: [AssetDestinationEntry]
$sel:assetDestinations:ExportAssetsToS3RequestDetails' :: ExportAssetsToS3RequestDetails -> [AssetDestinationEntry]
assetDestinations} -> [AssetDestinationEntry]
assetDestinations) (\s :: ExportAssetsToS3RequestDetails
s@ExportAssetsToS3RequestDetails' {} [AssetDestinationEntry]
a -> ExportAssetsToS3RequestDetails
s {$sel:assetDestinations:ExportAssetsToS3RequestDetails' :: [AssetDestinationEntry]
assetDestinations = [AssetDestinationEntry]
a} :: ExportAssetsToS3RequestDetails) (([AssetDestinationEntry] -> f [AssetDestinationEntry])
 -> ExportAssetsToS3RequestDetails
 -> f ExportAssetsToS3RequestDetails)
-> (([AssetDestinationEntry] -> f [AssetDestinationEntry])
    -> [AssetDestinationEntry] -> f [AssetDestinationEntry])
-> ([AssetDestinationEntry] -> f [AssetDestinationEntry])
-> ExportAssetsToS3RequestDetails
-> f ExportAssetsToS3RequestDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([AssetDestinationEntry] -> f [AssetDestinationEntry])
-> [AssetDestinationEntry] -> f [AssetDestinationEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance
  Prelude.Hashable
    ExportAssetsToS3RequestDetails

instance
  Prelude.NFData
    ExportAssetsToS3RequestDetails

instance Core.ToJSON ExportAssetsToS3RequestDetails where
  toJSON :: ExportAssetsToS3RequestDetails -> Value
toJSON ExportAssetsToS3RequestDetails' {[AssetDestinationEntry]
Maybe ExportServerSideEncryption
Text
revisionId :: Text
dataSetId :: Text
assetDestinations :: [AssetDestinationEntry]
encryption :: Maybe ExportServerSideEncryption
$sel:revisionId:ExportAssetsToS3RequestDetails' :: ExportAssetsToS3RequestDetails -> Text
$sel:dataSetId:ExportAssetsToS3RequestDetails' :: ExportAssetsToS3RequestDetails -> Text
$sel:assetDestinations:ExportAssetsToS3RequestDetails' :: ExportAssetsToS3RequestDetails -> [AssetDestinationEntry]
$sel:encryption:ExportAssetsToS3RequestDetails' :: ExportAssetsToS3RequestDetails -> Maybe ExportServerSideEncryption
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"Encryption" Text -> ExportServerSideEncryption -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ExportServerSideEncryption -> Pair)
-> Maybe ExportServerSideEncryption -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ExportServerSideEncryption
encryption,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"AssetDestinations" Text -> [AssetDestinationEntry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [AssetDestinationEntry]
assetDestinations),
            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
"RevisionId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
revisionId)
          ]
      )