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

-- |
-- Create a value of 'ExportAssetsToS3ResponseDetails' 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', 'exportAssetsToS3ResponseDetails_encryption' - Encryption configuration of the export job.
--
-- 'assetDestinations', 'exportAssetsToS3ResponseDetails_assetDestinations' - The destination in Amazon S3 where the asset is exported.
--
-- 'dataSetId', 'exportAssetsToS3ResponseDetails_dataSetId' - The unique identifier for the data set associated with this export job.
--
-- 'revisionId', 'exportAssetsToS3ResponseDetails_revisionId' - The unique identifier for the revision associated with this export
-- response.
newExportAssetsToS3ResponseDetails ::
  -- | 'dataSetId'
  Prelude.Text ->
  -- | 'revisionId'
  Prelude.Text ->
  ExportAssetsToS3ResponseDetails
newExportAssetsToS3ResponseDetails :: Text -> Text -> ExportAssetsToS3ResponseDetails
newExportAssetsToS3ResponseDetails
  Text
pDataSetId_
  Text
pRevisionId_ =
    ExportAssetsToS3ResponseDetails' :: Maybe ExportServerSideEncryption
-> [AssetDestinationEntry]
-> Text
-> Text
-> ExportAssetsToS3ResponseDetails
ExportAssetsToS3ResponseDetails'
      { $sel:encryption:ExportAssetsToS3ResponseDetails' :: Maybe ExportServerSideEncryption
encryption =
          Maybe ExportServerSideEncryption
forall a. Maybe a
Prelude.Nothing,
        $sel:assetDestinations:ExportAssetsToS3ResponseDetails' :: [AssetDestinationEntry]
assetDestinations = [AssetDestinationEntry]
forall a. Monoid a => a
Prelude.mempty,
        $sel:dataSetId:ExportAssetsToS3ResponseDetails' :: Text
dataSetId = Text
pDataSetId_,
        $sel:revisionId:ExportAssetsToS3ResponseDetails' :: Text
revisionId = Text
pRevisionId_
      }

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

-- | The destination in Amazon S3 where the asset is exported.
exportAssetsToS3ResponseDetails_assetDestinations :: Lens.Lens' ExportAssetsToS3ResponseDetails [AssetDestinationEntry]
exportAssetsToS3ResponseDetails_assetDestinations :: ([AssetDestinationEntry] -> f [AssetDestinationEntry])
-> ExportAssetsToS3ResponseDetails
-> f ExportAssetsToS3ResponseDetails
exportAssetsToS3ResponseDetails_assetDestinations = (ExportAssetsToS3ResponseDetails -> [AssetDestinationEntry])
-> (ExportAssetsToS3ResponseDetails
    -> [AssetDestinationEntry] -> ExportAssetsToS3ResponseDetails)
-> Lens
     ExportAssetsToS3ResponseDetails
     ExportAssetsToS3ResponseDetails
     [AssetDestinationEntry]
     [AssetDestinationEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportAssetsToS3ResponseDetails' {[AssetDestinationEntry]
assetDestinations :: [AssetDestinationEntry]
$sel:assetDestinations:ExportAssetsToS3ResponseDetails' :: ExportAssetsToS3ResponseDetails -> [AssetDestinationEntry]
assetDestinations} -> [AssetDestinationEntry]
assetDestinations) (\s :: ExportAssetsToS3ResponseDetails
s@ExportAssetsToS3ResponseDetails' {} [AssetDestinationEntry]
a -> ExportAssetsToS3ResponseDetails
s {$sel:assetDestinations:ExportAssetsToS3ResponseDetails' :: [AssetDestinationEntry]
assetDestinations = [AssetDestinationEntry]
a} :: ExportAssetsToS3ResponseDetails) (([AssetDestinationEntry] -> f [AssetDestinationEntry])
 -> ExportAssetsToS3ResponseDetails
 -> f ExportAssetsToS3ResponseDetails)
-> (([AssetDestinationEntry] -> f [AssetDestinationEntry])
    -> [AssetDestinationEntry] -> f [AssetDestinationEntry])
-> ([AssetDestinationEntry] -> f [AssetDestinationEntry])
-> ExportAssetsToS3ResponseDetails
-> f ExportAssetsToS3ResponseDetails
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.
exportAssetsToS3ResponseDetails_dataSetId :: Lens.Lens' ExportAssetsToS3ResponseDetails Prelude.Text
exportAssetsToS3ResponseDetails_dataSetId :: (Text -> f Text)
-> ExportAssetsToS3ResponseDetails
-> f ExportAssetsToS3ResponseDetails
exportAssetsToS3ResponseDetails_dataSetId = (ExportAssetsToS3ResponseDetails -> Text)
-> (ExportAssetsToS3ResponseDetails
    -> Text -> ExportAssetsToS3ResponseDetails)
-> Lens
     ExportAssetsToS3ResponseDetails
     ExportAssetsToS3ResponseDetails
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ExportAssetsToS3ResponseDetails' {Text
dataSetId :: Text
$sel:dataSetId:ExportAssetsToS3ResponseDetails' :: ExportAssetsToS3ResponseDetails -> Text
dataSetId} -> Text
dataSetId) (\s :: ExportAssetsToS3ResponseDetails
s@ExportAssetsToS3ResponseDetails' {} Text
a -> ExportAssetsToS3ResponseDetails
s {$sel:dataSetId:ExportAssetsToS3ResponseDetails' :: Text
dataSetId = Text
a} :: ExportAssetsToS3ResponseDetails)

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

instance
  Core.FromJSON
    ExportAssetsToS3ResponseDetails
  where
  parseJSON :: Value -> Parser ExportAssetsToS3ResponseDetails
parseJSON =
    String
-> (Object -> Parser ExportAssetsToS3ResponseDetails)
-> Value
-> Parser ExportAssetsToS3ResponseDetails
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ExportAssetsToS3ResponseDetails"
      ( \Object
x ->
          Maybe ExportServerSideEncryption
-> [AssetDestinationEntry]
-> Text
-> Text
-> ExportAssetsToS3ResponseDetails
ExportAssetsToS3ResponseDetails'
            (Maybe ExportServerSideEncryption
 -> [AssetDestinationEntry]
 -> Text
 -> Text
 -> ExportAssetsToS3ResponseDetails)
-> Parser (Maybe ExportServerSideEncryption)
-> Parser
     ([AssetDestinationEntry]
      -> Text -> Text -> ExportAssetsToS3ResponseDetails)
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
  ([AssetDestinationEntry]
   -> Text -> Text -> ExportAssetsToS3ResponseDetails)
-> Parser [AssetDestinationEntry]
-> Parser (Text -> Text -> ExportAssetsToS3ResponseDetails)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [AssetDestinationEntry])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AssetDestinations"
                            Parser (Maybe [AssetDestinationEntry])
-> [AssetDestinationEntry] -> Parser [AssetDestinationEntry]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [AssetDestinationEntry]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Text -> Text -> ExportAssetsToS3ResponseDetails)
-> Parser Text -> Parser (Text -> ExportAssetsToS3ResponseDetails)
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")
            Parser (Text -> ExportAssetsToS3ResponseDetails)
-> Parser Text -> Parser ExportAssetsToS3ResponseDetails
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
"RevisionId")
      )

instance
  Prelude.Hashable
    ExportAssetsToS3ResponseDetails

instance
  Prelude.NFData
    ExportAssetsToS3ResponseDetails