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

import qualified Amazonka.Core as Core
import Amazonka.DataExchange.Types.RedshiftDataShareAssetSourceEntry
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Details from an import from Amazon Redshift datashare response.
--
-- /See:/ 'newImportAssetsFromRedshiftDataSharesResponseDetails' smart constructor.
data ImportAssetsFromRedshiftDataSharesResponseDetails = ImportAssetsFromRedshiftDataSharesResponseDetails'
  { -- | The unique identifier for the data set associated with this import job.
    ImportAssetsFromRedshiftDataSharesResponseDetails -> Text
dataSetId :: Prelude.Text,
    -- | A list of Amazon Redshift datashare asset sources.
    ImportAssetsFromRedshiftDataSharesResponseDetails
-> [RedshiftDataShareAssetSourceEntry]
assetSources :: [RedshiftDataShareAssetSourceEntry],
    -- | The unique identifier for the revision associated with this import job.
    ImportAssetsFromRedshiftDataSharesResponseDetails -> Text
revisionId :: Prelude.Text
  }
  deriving (ImportAssetsFromRedshiftDataSharesResponseDetails
-> ImportAssetsFromRedshiftDataSharesResponseDetails -> Bool
(ImportAssetsFromRedshiftDataSharesResponseDetails
 -> ImportAssetsFromRedshiftDataSharesResponseDetails -> Bool)
-> (ImportAssetsFromRedshiftDataSharesResponseDetails
    -> ImportAssetsFromRedshiftDataSharesResponseDetails -> Bool)
-> Eq ImportAssetsFromRedshiftDataSharesResponseDetails
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ImportAssetsFromRedshiftDataSharesResponseDetails
-> ImportAssetsFromRedshiftDataSharesResponseDetails -> Bool
$c/= :: ImportAssetsFromRedshiftDataSharesResponseDetails
-> ImportAssetsFromRedshiftDataSharesResponseDetails -> Bool
== :: ImportAssetsFromRedshiftDataSharesResponseDetails
-> ImportAssetsFromRedshiftDataSharesResponseDetails -> Bool
$c== :: ImportAssetsFromRedshiftDataSharesResponseDetails
-> ImportAssetsFromRedshiftDataSharesResponseDetails -> Bool
Prelude.Eq, ReadPrec [ImportAssetsFromRedshiftDataSharesResponseDetails]
ReadPrec ImportAssetsFromRedshiftDataSharesResponseDetails
Int -> ReadS ImportAssetsFromRedshiftDataSharesResponseDetails
ReadS [ImportAssetsFromRedshiftDataSharesResponseDetails]
(Int -> ReadS ImportAssetsFromRedshiftDataSharesResponseDetails)
-> ReadS [ImportAssetsFromRedshiftDataSharesResponseDetails]
-> ReadPrec ImportAssetsFromRedshiftDataSharesResponseDetails
-> ReadPrec [ImportAssetsFromRedshiftDataSharesResponseDetails]
-> Read ImportAssetsFromRedshiftDataSharesResponseDetails
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ImportAssetsFromRedshiftDataSharesResponseDetails]
$creadListPrec :: ReadPrec [ImportAssetsFromRedshiftDataSharesResponseDetails]
readPrec :: ReadPrec ImportAssetsFromRedshiftDataSharesResponseDetails
$creadPrec :: ReadPrec ImportAssetsFromRedshiftDataSharesResponseDetails
readList :: ReadS [ImportAssetsFromRedshiftDataSharesResponseDetails]
$creadList :: ReadS [ImportAssetsFromRedshiftDataSharesResponseDetails]
readsPrec :: Int -> ReadS ImportAssetsFromRedshiftDataSharesResponseDetails
$creadsPrec :: Int -> ReadS ImportAssetsFromRedshiftDataSharesResponseDetails
Prelude.Read, Int -> ImportAssetsFromRedshiftDataSharesResponseDetails -> ShowS
[ImportAssetsFromRedshiftDataSharesResponseDetails] -> ShowS
ImportAssetsFromRedshiftDataSharesResponseDetails -> String
(Int -> ImportAssetsFromRedshiftDataSharesResponseDetails -> ShowS)
-> (ImportAssetsFromRedshiftDataSharesResponseDetails -> String)
-> ([ImportAssetsFromRedshiftDataSharesResponseDetails] -> ShowS)
-> Show ImportAssetsFromRedshiftDataSharesResponseDetails
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ImportAssetsFromRedshiftDataSharesResponseDetails] -> ShowS
$cshowList :: [ImportAssetsFromRedshiftDataSharesResponseDetails] -> ShowS
show :: ImportAssetsFromRedshiftDataSharesResponseDetails -> String
$cshow :: ImportAssetsFromRedshiftDataSharesResponseDetails -> String
showsPrec :: Int -> ImportAssetsFromRedshiftDataSharesResponseDetails -> ShowS
$cshowsPrec :: Int -> ImportAssetsFromRedshiftDataSharesResponseDetails -> ShowS
Prelude.Show, (forall x.
 ImportAssetsFromRedshiftDataSharesResponseDetails
 -> Rep ImportAssetsFromRedshiftDataSharesResponseDetails x)
-> (forall x.
    Rep ImportAssetsFromRedshiftDataSharesResponseDetails x
    -> ImportAssetsFromRedshiftDataSharesResponseDetails)
-> Generic ImportAssetsFromRedshiftDataSharesResponseDetails
forall x.
Rep ImportAssetsFromRedshiftDataSharesResponseDetails x
-> ImportAssetsFromRedshiftDataSharesResponseDetails
forall x.
ImportAssetsFromRedshiftDataSharesResponseDetails
-> Rep ImportAssetsFromRedshiftDataSharesResponseDetails x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ImportAssetsFromRedshiftDataSharesResponseDetails x
-> ImportAssetsFromRedshiftDataSharesResponseDetails
$cfrom :: forall x.
ImportAssetsFromRedshiftDataSharesResponseDetails
-> Rep ImportAssetsFromRedshiftDataSharesResponseDetails x
Prelude.Generic)

-- |
-- Create a value of 'ImportAssetsFromRedshiftDataSharesResponseDetails' 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:
--
-- 'dataSetId', 'importAssetsFromRedshiftDataSharesResponseDetails_dataSetId' - The unique identifier for the data set associated with this import job.
--
-- 'assetSources', 'importAssetsFromRedshiftDataSharesResponseDetails_assetSources' - A list of Amazon Redshift datashare asset sources.
--
-- 'revisionId', 'importAssetsFromRedshiftDataSharesResponseDetails_revisionId' - The unique identifier for the revision associated with this import job.
newImportAssetsFromRedshiftDataSharesResponseDetails ::
  -- | 'dataSetId'
  Prelude.Text ->
  -- | 'revisionId'
  Prelude.Text ->
  ImportAssetsFromRedshiftDataSharesResponseDetails
newImportAssetsFromRedshiftDataSharesResponseDetails :: Text -> Text -> ImportAssetsFromRedshiftDataSharesResponseDetails
newImportAssetsFromRedshiftDataSharesResponseDetails
  Text
pDataSetId_
  Text
pRevisionId_ =
    ImportAssetsFromRedshiftDataSharesResponseDetails' :: Text
-> [RedshiftDataShareAssetSourceEntry]
-> Text
-> ImportAssetsFromRedshiftDataSharesResponseDetails
ImportAssetsFromRedshiftDataSharesResponseDetails'
      { $sel:dataSetId:ImportAssetsFromRedshiftDataSharesResponseDetails' :: Text
dataSetId =
          Text
pDataSetId_,
        $sel:assetSources:ImportAssetsFromRedshiftDataSharesResponseDetails' :: [RedshiftDataShareAssetSourceEntry]
assetSources =
          [RedshiftDataShareAssetSourceEntry]
forall a. Monoid a => a
Prelude.mempty,
        $sel:revisionId:ImportAssetsFromRedshiftDataSharesResponseDetails' :: Text
revisionId =
          Text
pRevisionId_
      }

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

-- | A list of Amazon Redshift datashare asset sources.
importAssetsFromRedshiftDataSharesResponseDetails_assetSources :: Lens.Lens' ImportAssetsFromRedshiftDataSharesResponseDetails [RedshiftDataShareAssetSourceEntry]
importAssetsFromRedshiftDataSharesResponseDetails_assetSources :: ([RedshiftDataShareAssetSourceEntry]
 -> f [RedshiftDataShareAssetSourceEntry])
-> ImportAssetsFromRedshiftDataSharesResponseDetails
-> f ImportAssetsFromRedshiftDataSharesResponseDetails
importAssetsFromRedshiftDataSharesResponseDetails_assetSources = (ImportAssetsFromRedshiftDataSharesResponseDetails
 -> [RedshiftDataShareAssetSourceEntry])
-> (ImportAssetsFromRedshiftDataSharesResponseDetails
    -> [RedshiftDataShareAssetSourceEntry]
    -> ImportAssetsFromRedshiftDataSharesResponseDetails)
-> Lens
     ImportAssetsFromRedshiftDataSharesResponseDetails
     ImportAssetsFromRedshiftDataSharesResponseDetails
     [RedshiftDataShareAssetSourceEntry]
     [RedshiftDataShareAssetSourceEntry]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ImportAssetsFromRedshiftDataSharesResponseDetails' {[RedshiftDataShareAssetSourceEntry]
assetSources :: [RedshiftDataShareAssetSourceEntry]
$sel:assetSources:ImportAssetsFromRedshiftDataSharesResponseDetails' :: ImportAssetsFromRedshiftDataSharesResponseDetails
-> [RedshiftDataShareAssetSourceEntry]
assetSources} -> [RedshiftDataShareAssetSourceEntry]
assetSources) (\s :: ImportAssetsFromRedshiftDataSharesResponseDetails
s@ImportAssetsFromRedshiftDataSharesResponseDetails' {} [RedshiftDataShareAssetSourceEntry]
a -> ImportAssetsFromRedshiftDataSharesResponseDetails
s {$sel:assetSources:ImportAssetsFromRedshiftDataSharesResponseDetails' :: [RedshiftDataShareAssetSourceEntry]
assetSources = [RedshiftDataShareAssetSourceEntry]
a} :: ImportAssetsFromRedshiftDataSharesResponseDetails) (([RedshiftDataShareAssetSourceEntry]
  -> f [RedshiftDataShareAssetSourceEntry])
 -> ImportAssetsFromRedshiftDataSharesResponseDetails
 -> f ImportAssetsFromRedshiftDataSharesResponseDetails)
-> (([RedshiftDataShareAssetSourceEntry]
     -> f [RedshiftDataShareAssetSourceEntry])
    -> [RedshiftDataShareAssetSourceEntry]
    -> f [RedshiftDataShareAssetSourceEntry])
-> ([RedshiftDataShareAssetSourceEntry]
    -> f [RedshiftDataShareAssetSourceEntry])
-> ImportAssetsFromRedshiftDataSharesResponseDetails
-> f ImportAssetsFromRedshiftDataSharesResponseDetails
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([RedshiftDataShareAssetSourceEntry]
 -> f [RedshiftDataShareAssetSourceEntry])
-> [RedshiftDataShareAssetSourceEntry]
-> f [RedshiftDataShareAssetSourceEntry]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

instance
  Prelude.NFData
    ImportAssetsFromRedshiftDataSharesResponseDetails