{-# 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.ExportRevisionsToS3ResponseDetails
-- 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.ExportRevisionsToS3ResponseDetails 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 about the export revisions to Amazon S3 response.
--
-- /See:/ 'newExportRevisionsToS3ResponseDetails' smart constructor.
data ExportRevisionsToS3ResponseDetails = ExportRevisionsToS3ResponseDetails'
  { -- | Encryption configuration of the export job.
    ExportRevisionsToS3ResponseDetails
-> Maybe ExportServerSideEncryption
encryption :: Prelude.Maybe ExportServerSideEncryption,
    -- | The Amazon Resource Name (ARN) of the event action.
    ExportRevisionsToS3ResponseDetails -> Maybe Text
eventActionArn :: Prelude.Maybe Prelude.Text,
    -- | The destination in Amazon S3 where the revision is exported.
    ExportRevisionsToS3ResponseDetails -> [RevisionDestinationEntry]
revisionDestinations :: [RevisionDestinationEntry],
    -- | The unique identifier for the data set associated with this export job.
    ExportRevisionsToS3ResponseDetails -> Text
dataSetId :: Prelude.Text
  }
  deriving (ExportRevisionsToS3ResponseDetails
-> ExportRevisionsToS3ResponseDetails -> Bool
(ExportRevisionsToS3ResponseDetails
 -> ExportRevisionsToS3ResponseDetails -> Bool)
-> (ExportRevisionsToS3ResponseDetails
    -> ExportRevisionsToS3ResponseDetails -> Bool)
-> Eq ExportRevisionsToS3ResponseDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ExportRevisionsToS3ResponseDetails
-> ExportRevisionsToS3ResponseDetails -> Bool
$c/= :: ExportRevisionsToS3ResponseDetails
-> ExportRevisionsToS3ResponseDetails -> Bool
== :: ExportRevisionsToS3ResponseDetails
-> ExportRevisionsToS3ResponseDetails -> Bool
$c== :: ExportRevisionsToS3ResponseDetails
-> ExportRevisionsToS3ResponseDetails -> Bool
Prelude.Eq, ReadPrec [ExportRevisionsToS3ResponseDetails]
ReadPrec ExportRevisionsToS3ResponseDetails
Int -> ReadS ExportRevisionsToS3ResponseDetails
ReadS [ExportRevisionsToS3ResponseDetails]
(Int -> ReadS ExportRevisionsToS3ResponseDetails)
-> ReadS [ExportRevisionsToS3ResponseDetails]
-> ReadPrec ExportRevisionsToS3ResponseDetails
-> ReadPrec [ExportRevisionsToS3ResponseDetails]
-> Read ExportRevisionsToS3ResponseDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ExportRevisionsToS3ResponseDetails]
$creadListPrec :: ReadPrec [ExportRevisionsToS3ResponseDetails]
readPrec :: ReadPrec ExportRevisionsToS3ResponseDetails
$creadPrec :: ReadPrec ExportRevisionsToS3ResponseDetails
readList :: ReadS [ExportRevisionsToS3ResponseDetails]
$creadList :: ReadS [ExportRevisionsToS3ResponseDetails]
readsPrec :: Int -> ReadS ExportRevisionsToS3ResponseDetails
$creadsPrec :: Int -> ReadS ExportRevisionsToS3ResponseDetails
Prelude.Read, Int -> ExportRevisionsToS3ResponseDetails -> ShowS
[ExportRevisionsToS3ResponseDetails] -> ShowS
ExportRevisionsToS3ResponseDetails -> String
(Int -> ExportRevisionsToS3ResponseDetails -> ShowS)
-> (ExportRevisionsToS3ResponseDetails -> String)
-> ([ExportRevisionsToS3ResponseDetails] -> ShowS)
-> Show ExportRevisionsToS3ResponseDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ExportRevisionsToS3ResponseDetails] -> ShowS
$cshowList :: [ExportRevisionsToS3ResponseDetails] -> ShowS
show :: ExportRevisionsToS3ResponseDetails -> String
$cshow :: ExportRevisionsToS3ResponseDetails -> String
showsPrec :: Int -> ExportRevisionsToS3ResponseDetails -> ShowS
$cshowsPrec :: Int -> ExportRevisionsToS3ResponseDetails -> ShowS
Prelude.Show, (forall x.
 ExportRevisionsToS3ResponseDetails
 -> Rep ExportRevisionsToS3ResponseDetails x)
-> (forall x.
    Rep ExportRevisionsToS3ResponseDetails x
    -> ExportRevisionsToS3ResponseDetails)
-> Generic ExportRevisionsToS3ResponseDetails
forall x.
Rep ExportRevisionsToS3ResponseDetails x
-> ExportRevisionsToS3ResponseDetails
forall x.
ExportRevisionsToS3ResponseDetails
-> Rep ExportRevisionsToS3ResponseDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ExportRevisionsToS3ResponseDetails x
-> ExportRevisionsToS3ResponseDetails
$cfrom :: forall x.
ExportRevisionsToS3ResponseDetails
-> Rep ExportRevisionsToS3ResponseDetails x
Prelude.Generic)

-- |
-- Create a value of 'ExportRevisionsToS3ResponseDetails' 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', 'exportRevisionsToS3ResponseDetails_encryption' - Encryption configuration of the export job.
--
-- 'eventActionArn', 'exportRevisionsToS3ResponseDetails_eventActionArn' - The Amazon Resource Name (ARN) of the event action.
--
-- 'revisionDestinations', 'exportRevisionsToS3ResponseDetails_revisionDestinations' - The destination in Amazon S3 where the revision is exported.
--
-- 'dataSetId', 'exportRevisionsToS3ResponseDetails_dataSetId' - The unique identifier for the data set associated with this export job.
newExportRevisionsToS3ResponseDetails ::
  -- | 'dataSetId'
  Prelude.Text ->
  ExportRevisionsToS3ResponseDetails
newExportRevisionsToS3ResponseDetails :: Text -> ExportRevisionsToS3ResponseDetails
newExportRevisionsToS3ResponseDetails Text
pDataSetId_ =
  ExportRevisionsToS3ResponseDetails' :: Maybe ExportServerSideEncryption
-> Maybe Text
-> [RevisionDestinationEntry]
-> Text
-> ExportRevisionsToS3ResponseDetails
ExportRevisionsToS3ResponseDetails'
    { $sel:encryption:ExportRevisionsToS3ResponseDetails' :: Maybe ExportServerSideEncryption
encryption =
        Maybe ExportServerSideEncryption
forall a. Maybe a
Prelude.Nothing,
      $sel:eventActionArn:ExportRevisionsToS3ResponseDetails' :: Maybe Text
eventActionArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:revisionDestinations:ExportRevisionsToS3ResponseDetails' :: [RevisionDestinationEntry]
revisionDestinations = [RevisionDestinationEntry]
forall a. Monoid a => a
Prelude.mempty,
      $sel:dataSetId:ExportRevisionsToS3ResponseDetails' :: Text
dataSetId = Text
pDataSetId_
    }

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

-- | The Amazon Resource Name (ARN) of the event action.
exportRevisionsToS3ResponseDetails_eventActionArn :: Lens.Lens' ExportRevisionsToS3ResponseDetails (Prelude.Maybe Prelude.Text)
exportRevisionsToS3ResponseDetails_eventActionArn :: (Maybe Text -> f (Maybe Text))
-> ExportRevisionsToS3ResponseDetails
-> f ExportRevisionsToS3ResponseDetails
exportRevisionsToS3ResponseDetails_eventActionArn = (ExportRevisionsToS3ResponseDetails -> Maybe Text)
-> (ExportRevisionsToS3ResponseDetails
    -> Maybe Text -> ExportRevisionsToS3ResponseDetails)
-> Lens
     ExportRevisionsToS3ResponseDetails
     ExportRevisionsToS3ResponseDetails
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportRevisionsToS3ResponseDetails' {Maybe Text
eventActionArn :: Maybe Text
$sel:eventActionArn:ExportRevisionsToS3ResponseDetails' :: ExportRevisionsToS3ResponseDetails -> Maybe Text
eventActionArn} -> Maybe Text
eventActionArn) (\s :: ExportRevisionsToS3ResponseDetails
s@ExportRevisionsToS3ResponseDetails' {} Maybe Text
a -> ExportRevisionsToS3ResponseDetails
s {$sel:eventActionArn:ExportRevisionsToS3ResponseDetails' :: Maybe Text
eventActionArn = Maybe Text
a} :: ExportRevisionsToS3ResponseDetails)

-- | The destination in Amazon S3 where the revision is exported.
exportRevisionsToS3ResponseDetails_revisionDestinations :: Lens.Lens' ExportRevisionsToS3ResponseDetails [RevisionDestinationEntry]
exportRevisionsToS3ResponseDetails_revisionDestinations :: ([RevisionDestinationEntry] -> f [RevisionDestinationEntry])
-> ExportRevisionsToS3ResponseDetails
-> f ExportRevisionsToS3ResponseDetails
exportRevisionsToS3ResponseDetails_revisionDestinations = (ExportRevisionsToS3ResponseDetails -> [RevisionDestinationEntry])
-> (ExportRevisionsToS3ResponseDetails
    -> [RevisionDestinationEntry]
    -> ExportRevisionsToS3ResponseDetails)
-> Lens
     ExportRevisionsToS3ResponseDetails
     ExportRevisionsToS3ResponseDetails
     [RevisionDestinationEntry]
     [RevisionDestinationEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportRevisionsToS3ResponseDetails' {[RevisionDestinationEntry]
revisionDestinations :: [RevisionDestinationEntry]
$sel:revisionDestinations:ExportRevisionsToS3ResponseDetails' :: ExportRevisionsToS3ResponseDetails -> [RevisionDestinationEntry]
revisionDestinations} -> [RevisionDestinationEntry]
revisionDestinations) (\s :: ExportRevisionsToS3ResponseDetails
s@ExportRevisionsToS3ResponseDetails' {} [RevisionDestinationEntry]
a -> ExportRevisionsToS3ResponseDetails
s {$sel:revisionDestinations:ExportRevisionsToS3ResponseDetails' :: [RevisionDestinationEntry]
revisionDestinations = [RevisionDestinationEntry]
a} :: ExportRevisionsToS3ResponseDetails) (([RevisionDestinationEntry] -> f [RevisionDestinationEntry])
 -> ExportRevisionsToS3ResponseDetails
 -> f ExportRevisionsToS3ResponseDetails)
-> (([RevisionDestinationEntry] -> f [RevisionDestinationEntry])
    -> [RevisionDestinationEntry] -> f [RevisionDestinationEntry])
-> ([RevisionDestinationEntry] -> f [RevisionDestinationEntry])
-> ExportRevisionsToS3ResponseDetails
-> f ExportRevisionsToS3ResponseDetails
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.
exportRevisionsToS3ResponseDetails_dataSetId :: Lens.Lens' ExportRevisionsToS3ResponseDetails Prelude.Text
exportRevisionsToS3ResponseDetails_dataSetId :: (Text -> f Text)
-> ExportRevisionsToS3ResponseDetails
-> f ExportRevisionsToS3ResponseDetails
exportRevisionsToS3ResponseDetails_dataSetId = (ExportRevisionsToS3ResponseDetails -> Text)
-> (ExportRevisionsToS3ResponseDetails
    -> Text -> ExportRevisionsToS3ResponseDetails)
-> Lens
     ExportRevisionsToS3ResponseDetails
     ExportRevisionsToS3ResponseDetails
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportRevisionsToS3ResponseDetails' {Text
dataSetId :: Text
$sel:dataSetId:ExportRevisionsToS3ResponseDetails' :: ExportRevisionsToS3ResponseDetails -> Text
dataSetId} -> Text
dataSetId) (\s :: ExportRevisionsToS3ResponseDetails
s@ExportRevisionsToS3ResponseDetails' {} Text
a -> ExportRevisionsToS3ResponseDetails
s {$sel:dataSetId:ExportRevisionsToS3ResponseDetails' :: Text
dataSetId = Text
a} :: ExportRevisionsToS3ResponseDetails)

instance
  Core.FromJSON
    ExportRevisionsToS3ResponseDetails
  where
  parseJSON :: Value -> Parser ExportRevisionsToS3ResponseDetails
parseJSON =
    String
-> (Object -> Parser ExportRevisionsToS3ResponseDetails)
-> Value
-> Parser ExportRevisionsToS3ResponseDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExportRevisionsToS3ResponseDetails"
      ( \Object
x ->
          Maybe ExportServerSideEncryption
-> Maybe Text
-> [RevisionDestinationEntry]
-> Text
-> ExportRevisionsToS3ResponseDetails
ExportRevisionsToS3ResponseDetails'
            (Maybe ExportServerSideEncryption
 -> Maybe Text
 -> [RevisionDestinationEntry]
 -> Text
 -> ExportRevisionsToS3ResponseDetails)
-> Parser (Maybe ExportServerSideEncryption)
-> Parser
     (Maybe Text
      -> [RevisionDestinationEntry]
      -> Text
      -> ExportRevisionsToS3ResponseDetails)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ExportServerSideEncryption)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Encryption")
            Parser
  (Maybe Text
   -> [RevisionDestinationEntry]
   -> Text
   -> ExportRevisionsToS3ResponseDetails)
-> Parser (Maybe Text)
-> Parser
     ([RevisionDestinationEntry]
      -> Text -> ExportRevisionsToS3ResponseDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"EventActionArn")
            Parser
  ([RevisionDestinationEntry]
   -> Text -> ExportRevisionsToS3ResponseDetails)
-> Parser [RevisionDestinationEntry]
-> Parser (Text -> ExportRevisionsToS3ResponseDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [RevisionDestinationEntry])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RevisionDestinations"
                            Parser (Maybe [RevisionDestinationEntry])
-> [RevisionDestinationEntry] -> Parser [RevisionDestinationEntry]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [RevisionDestinationEntry]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Text -> ExportRevisionsToS3ResponseDetails)
-> Parser Text -> Parser ExportRevisionsToS3ResponseDetails
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
"DataSetId")
      )

instance
  Prelude.Hashable
    ExportRevisionsToS3ResponseDetails

instance
  Prelude.NFData
    ExportRevisionsToS3ResponseDetails