{-# 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.Personalize.Types.DatasetExportJobOutput
-- 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.Personalize.Types.DatasetExportJobOutput where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.Personalize.Types.S3DataConfig
import qualified Amazonka.Prelude as Prelude

-- | The output configuration parameters of a dataset export job.
--
-- /See:/ 'newDatasetExportJobOutput' smart constructor.
data DatasetExportJobOutput = DatasetExportJobOutput'
  { DatasetExportJobOutput -> S3DataConfig
s3DataDestination :: S3DataConfig
  }
  deriving (DatasetExportJobOutput -> DatasetExportJobOutput -> Bool
(DatasetExportJobOutput -> DatasetExportJobOutput -> Bool)
-> (DatasetExportJobOutput -> DatasetExportJobOutput -> Bool)
-> Eq DatasetExportJobOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DatasetExportJobOutput -> DatasetExportJobOutput -> Bool
$c/= :: DatasetExportJobOutput -> DatasetExportJobOutput -> Bool
== :: DatasetExportJobOutput -> DatasetExportJobOutput -> Bool
$c== :: DatasetExportJobOutput -> DatasetExportJobOutput -> Bool
Prelude.Eq, ReadPrec [DatasetExportJobOutput]
ReadPrec DatasetExportJobOutput
Int -> ReadS DatasetExportJobOutput
ReadS [DatasetExportJobOutput]
(Int -> ReadS DatasetExportJobOutput)
-> ReadS [DatasetExportJobOutput]
-> ReadPrec DatasetExportJobOutput
-> ReadPrec [DatasetExportJobOutput]
-> Read DatasetExportJobOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DatasetExportJobOutput]
$creadListPrec :: ReadPrec [DatasetExportJobOutput]
readPrec :: ReadPrec DatasetExportJobOutput
$creadPrec :: ReadPrec DatasetExportJobOutput
readList :: ReadS [DatasetExportJobOutput]
$creadList :: ReadS [DatasetExportJobOutput]
readsPrec :: Int -> ReadS DatasetExportJobOutput
$creadsPrec :: Int -> ReadS DatasetExportJobOutput
Prelude.Read, Int -> DatasetExportJobOutput -> ShowS
[DatasetExportJobOutput] -> ShowS
DatasetExportJobOutput -> String
(Int -> DatasetExportJobOutput -> ShowS)
-> (DatasetExportJobOutput -> String)
-> ([DatasetExportJobOutput] -> ShowS)
-> Show DatasetExportJobOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DatasetExportJobOutput] -> ShowS
$cshowList :: [DatasetExportJobOutput] -> ShowS
show :: DatasetExportJobOutput -> String
$cshow :: DatasetExportJobOutput -> String
showsPrec :: Int -> DatasetExportJobOutput -> ShowS
$cshowsPrec :: Int -> DatasetExportJobOutput -> ShowS
Prelude.Show, (forall x. DatasetExportJobOutput -> Rep DatasetExportJobOutput x)
-> (forall x.
    Rep DatasetExportJobOutput x -> DatasetExportJobOutput)
-> Generic DatasetExportJobOutput
forall x. Rep DatasetExportJobOutput x -> DatasetExportJobOutput
forall x. DatasetExportJobOutput -> Rep DatasetExportJobOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep DatasetExportJobOutput x -> DatasetExportJobOutput
$cfrom :: forall x. DatasetExportJobOutput -> Rep DatasetExportJobOutput x
Prelude.Generic)

-- |
-- Create a value of 'DatasetExportJobOutput' 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:
--
-- 's3DataDestination', 'datasetExportJobOutput_s3DataDestination' - Undocumented member.
newDatasetExportJobOutput ::
  -- | 's3DataDestination'
  S3DataConfig ->
  DatasetExportJobOutput
newDatasetExportJobOutput :: S3DataConfig -> DatasetExportJobOutput
newDatasetExportJobOutput S3DataConfig
pS3DataDestination_ =
  DatasetExportJobOutput' :: S3DataConfig -> DatasetExportJobOutput
DatasetExportJobOutput'
    { $sel:s3DataDestination:DatasetExportJobOutput' :: S3DataConfig
s3DataDestination =
        S3DataConfig
pS3DataDestination_
    }

-- | Undocumented member.
datasetExportJobOutput_s3DataDestination :: Lens.Lens' DatasetExportJobOutput S3DataConfig
datasetExportJobOutput_s3DataDestination :: (S3DataConfig -> f S3DataConfig)
-> DatasetExportJobOutput -> f DatasetExportJobOutput
datasetExportJobOutput_s3DataDestination = (DatasetExportJobOutput -> S3DataConfig)
-> (DatasetExportJobOutput
    -> S3DataConfig -> DatasetExportJobOutput)
-> Lens
     DatasetExportJobOutput
     DatasetExportJobOutput
     S3DataConfig
     S3DataConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DatasetExportJobOutput' {S3DataConfig
s3DataDestination :: S3DataConfig
$sel:s3DataDestination:DatasetExportJobOutput' :: DatasetExportJobOutput -> S3DataConfig
s3DataDestination} -> S3DataConfig
s3DataDestination) (\s :: DatasetExportJobOutput
s@DatasetExportJobOutput' {} S3DataConfig
a -> DatasetExportJobOutput
s {$sel:s3DataDestination:DatasetExportJobOutput' :: S3DataConfig
s3DataDestination = S3DataConfig
a} :: DatasetExportJobOutput)

instance Core.FromJSON DatasetExportJobOutput where
  parseJSON :: Value -> Parser DatasetExportJobOutput
parseJSON =
    String
-> (Object -> Parser DatasetExportJobOutput)
-> Value
-> Parser DatasetExportJobOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"DatasetExportJobOutput"
      ( \Object
x ->
          S3DataConfig -> DatasetExportJobOutput
DatasetExportJobOutput'
            (S3DataConfig -> DatasetExportJobOutput)
-> Parser S3DataConfig -> Parser DatasetExportJobOutput
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser S3DataConfig
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"s3DataDestination")
      )

instance Prelude.Hashable DatasetExportJobOutput

instance Prelude.NFData DatasetExportJobOutput

instance Core.ToJSON DatasetExportJobOutput where
  toJSON :: DatasetExportJobOutput -> Value
toJSON DatasetExportJobOutput' {S3DataConfig
s3DataDestination :: S3DataConfig
$sel:s3DataDestination:DatasetExportJobOutput' :: DatasetExportJobOutput -> S3DataConfig
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"s3DataDestination" Text -> S3DataConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= S3DataConfig
s3DataDestination)
          ]
      )