{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DataExchange.Types.ExportAssetsToS3ResponseDetails where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.DataExchange.Types.AssetDestinationEntry
import Amazonka.DataExchange.Types.ExportServerSideEncryption
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
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]
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
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.
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'
      { $sel:encryption:ExportAssetsToS3ResponseDetails' :: Maybe ExportServerSideEncryption
encryption =
          forall a. Maybe a
Prelude.Nothing,
        $sel:assetDestinations:ExportAssetsToS3ResponseDetails' :: [AssetDestinationEntry]
assetDestinations = 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 :: Lens'
  ExportAssetsToS3ResponseDetails (Maybe ExportServerSideEncryption)
exportAssetsToS3ResponseDetails_encryption = 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 :: Lens' ExportAssetsToS3ResponseDetails [AssetDestinationEntry]
exportAssetsToS3ResponseDetails_assetDestinations = 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) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. 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 :: Lens' ExportAssetsToS3ResponseDetails Text
exportAssetsToS3ResponseDetails_dataSetId = 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 :: Lens' ExportAssetsToS3ResponseDetails Text
exportAssetsToS3ResponseDetails_revisionId = 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
  Data.FromJSON
    ExportAssetsToS3ResponseDetails
  where
  parseJSON :: Value -> Parser ExportAssetsToS3ResponseDetails
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ExportAssetsToS3ResponseDetails"
      ( \Object
x ->
          Maybe ExportServerSideEncryption
-> [AssetDestinationEntry]
-> Text
-> Text
-> ExportAssetsToS3ResponseDetails
ExportAssetsToS3ResponseDetails'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Encryption")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"AssetDestinations"
                            forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty
                        )
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"DataSetId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"RevisionId")
      )

instance
  Prelude.Hashable
    ExportAssetsToS3ResponseDetails
  where
  hashWithSalt :: Int -> ExportAssetsToS3ResponseDetails -> Int
hashWithSalt
    Int
_salt
    ExportAssetsToS3ResponseDetails' {[AssetDestinationEntry]
Maybe ExportServerSideEncryption
Text
revisionId :: Text
dataSetId :: Text
assetDestinations :: [AssetDestinationEntry]
encryption :: Maybe ExportServerSideEncryption
$sel:revisionId:ExportAssetsToS3ResponseDetails' :: ExportAssetsToS3ResponseDetails -> Text
$sel:dataSetId:ExportAssetsToS3ResponseDetails' :: ExportAssetsToS3ResponseDetails -> Text
$sel:assetDestinations:ExportAssetsToS3ResponseDetails' :: ExportAssetsToS3ResponseDetails -> [AssetDestinationEntry]
$sel:encryption:ExportAssetsToS3ResponseDetails' :: ExportAssetsToS3ResponseDetails -> Maybe ExportServerSideEncryption
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ExportServerSideEncryption
encryption
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` [AssetDestinationEntry]
assetDestinations
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
dataSetId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
revisionId

instance
  Prelude.NFData
    ExportAssetsToS3ResponseDetails
  where
  rnf :: ExportAssetsToS3ResponseDetails -> ()
rnf ExportAssetsToS3ResponseDetails' {[AssetDestinationEntry]
Maybe ExportServerSideEncryption
Text
revisionId :: Text
dataSetId :: Text
assetDestinations :: [AssetDestinationEntry]
encryption :: Maybe ExportServerSideEncryption
$sel:revisionId:ExportAssetsToS3ResponseDetails' :: ExportAssetsToS3ResponseDetails -> Text
$sel:dataSetId:ExportAssetsToS3ResponseDetails' :: ExportAssetsToS3ResponseDetails -> Text
$sel:assetDestinations:ExportAssetsToS3ResponseDetails' :: ExportAssetsToS3ResponseDetails -> [AssetDestinationEntry]
$sel:encryption:ExportAssetsToS3ResponseDetails' :: ExportAssetsToS3ResponseDetails -> Maybe ExportServerSideEncryption
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe ExportServerSideEncryption
encryption
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf [AssetDestinationEntry]
assetDestinations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
dataSetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
revisionId