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

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

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

-- |
-- Create a value of 'ExportRevisionsToS3RequestDetails' 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', 'exportRevisionsToS3RequestDetails_encryption' - Encryption configuration for the export job.
--
-- 'revisionDestinations', 'exportRevisionsToS3RequestDetails_revisionDestinations' - The destination for the revision.
--
-- 'dataSetId', 'exportRevisionsToS3RequestDetails_dataSetId' - The unique identifier for the data set associated with this export job.
newExportRevisionsToS3RequestDetails ::
  -- | 'dataSetId'
  Prelude.Text ->
  ExportRevisionsToS3RequestDetails
newExportRevisionsToS3RequestDetails :: Text -> ExportRevisionsToS3RequestDetails
newExportRevisionsToS3RequestDetails Text
pDataSetId_ =
  ExportRevisionsToS3RequestDetails' :: Maybe ExportServerSideEncryption
-> [RevisionDestinationEntry]
-> Text
-> ExportRevisionsToS3RequestDetails
ExportRevisionsToS3RequestDetails'
    { $sel:encryption:ExportRevisionsToS3RequestDetails' :: Maybe ExportServerSideEncryption
encryption =
        Maybe ExportServerSideEncryption
forall a. Maybe a
Prelude.Nothing,
      $sel:revisionDestinations:ExportRevisionsToS3RequestDetails' :: [RevisionDestinationEntry]
revisionDestinations = [RevisionDestinationEntry]
forall a. Monoid a => a
Prelude.mempty,
      $sel:dataSetId:ExportRevisionsToS3RequestDetails' :: Text
dataSetId = Text
pDataSetId_
    }

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

-- | The destination for the revision.
exportRevisionsToS3RequestDetails_revisionDestinations :: Lens.Lens' ExportRevisionsToS3RequestDetails [RevisionDestinationEntry]
exportRevisionsToS3RequestDetails_revisionDestinations :: ([RevisionDestinationEntry] -> f [RevisionDestinationEntry])
-> ExportRevisionsToS3RequestDetails
-> f ExportRevisionsToS3RequestDetails
exportRevisionsToS3RequestDetails_revisionDestinations = (ExportRevisionsToS3RequestDetails -> [RevisionDestinationEntry])
-> (ExportRevisionsToS3RequestDetails
    -> [RevisionDestinationEntry] -> ExportRevisionsToS3RequestDetails)
-> Lens
     ExportRevisionsToS3RequestDetails
     ExportRevisionsToS3RequestDetails
     [RevisionDestinationEntry]
     [RevisionDestinationEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportRevisionsToS3RequestDetails' {[RevisionDestinationEntry]
revisionDestinations :: [RevisionDestinationEntry]
$sel:revisionDestinations:ExportRevisionsToS3RequestDetails' :: ExportRevisionsToS3RequestDetails -> [RevisionDestinationEntry]
revisionDestinations} -> [RevisionDestinationEntry]
revisionDestinations) (\s :: ExportRevisionsToS3RequestDetails
s@ExportRevisionsToS3RequestDetails' {} [RevisionDestinationEntry]
a -> ExportRevisionsToS3RequestDetails
s {$sel:revisionDestinations:ExportRevisionsToS3RequestDetails' :: [RevisionDestinationEntry]
revisionDestinations = [RevisionDestinationEntry]
a} :: ExportRevisionsToS3RequestDetails) (([RevisionDestinationEntry] -> f [RevisionDestinationEntry])
 -> ExportRevisionsToS3RequestDetails
 -> f ExportRevisionsToS3RequestDetails)
-> (([RevisionDestinationEntry] -> f [RevisionDestinationEntry])
    -> [RevisionDestinationEntry] -> f [RevisionDestinationEntry])
-> ([RevisionDestinationEntry] -> f [RevisionDestinationEntry])
-> ExportRevisionsToS3RequestDetails
-> f ExportRevisionsToS3RequestDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RevisionDestinationEntry] -> f [RevisionDestinationEntry])
-> [RevisionDestinationEntry] -> f [RevisionDestinationEntry]
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.
exportRevisionsToS3RequestDetails_dataSetId :: Lens.Lens' ExportRevisionsToS3RequestDetails Prelude.Text
exportRevisionsToS3RequestDetails_dataSetId :: (Text -> f Text)
-> ExportRevisionsToS3RequestDetails
-> f ExportRevisionsToS3RequestDetails
exportRevisionsToS3RequestDetails_dataSetId = (ExportRevisionsToS3RequestDetails -> Text)
-> (ExportRevisionsToS3RequestDetails
    -> Text -> ExportRevisionsToS3RequestDetails)
-> Lens
     ExportRevisionsToS3RequestDetails
     ExportRevisionsToS3RequestDetails
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportRevisionsToS3RequestDetails' {Text
dataSetId :: Text
$sel:dataSetId:ExportRevisionsToS3RequestDetails' :: ExportRevisionsToS3RequestDetails -> Text
dataSetId} -> Text
dataSetId) (\s :: ExportRevisionsToS3RequestDetails
s@ExportRevisionsToS3RequestDetails' {} Text
a -> ExportRevisionsToS3RequestDetails
s {$sel:dataSetId:ExportRevisionsToS3RequestDetails' :: Text
dataSetId = Text
a} :: ExportRevisionsToS3RequestDetails)

instance
  Prelude.Hashable
    ExportRevisionsToS3RequestDetails

instance
  Prelude.NFData
    ExportRevisionsToS3RequestDetails

instance
  Core.ToJSON
    ExportRevisionsToS3RequestDetails
  where
  toJSON :: ExportRevisionsToS3RequestDetails -> Value
toJSON ExportRevisionsToS3RequestDetails' {[RevisionDestinationEntry]
Maybe ExportServerSideEncryption
Text
dataSetId :: Text
revisionDestinations :: [RevisionDestinationEntry]
encryption :: Maybe ExportServerSideEncryption
$sel:dataSetId:ExportRevisionsToS3RequestDetails' :: ExportRevisionsToS3RequestDetails -> Text
$sel:revisionDestinations:ExportRevisionsToS3RequestDetails' :: ExportRevisionsToS3RequestDetails -> [RevisionDestinationEntry]
$sel:encryption:ExportRevisionsToS3RequestDetails' :: ExportRevisionsToS3RequestDetails
-> 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
"RevisionDestinations"
                  Text -> [RevisionDestinationEntry] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= [RevisionDestinationEntry]
revisionDestinations
              ),
            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)
          ]
      )