{-# 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.BatchInferenceJobOutput
-- 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.BatchInferenceJobOutput 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 batch inference job.
--
-- /See:/ 'newBatchInferenceJobOutput' smart constructor.
data BatchInferenceJobOutput = BatchInferenceJobOutput'
  { -- | Information on the Amazon S3 bucket in which the batch inference job\'s
    -- output is stored.
    BatchInferenceJobOutput -> S3DataConfig
s3DataDestination :: S3DataConfig
  }
  deriving (BatchInferenceJobOutput -> BatchInferenceJobOutput -> Bool
(BatchInferenceJobOutput -> BatchInferenceJobOutput -> Bool)
-> (BatchInferenceJobOutput -> BatchInferenceJobOutput -> Bool)
-> Eq BatchInferenceJobOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BatchInferenceJobOutput -> BatchInferenceJobOutput -> Bool
$c/= :: BatchInferenceJobOutput -> BatchInferenceJobOutput -> Bool
== :: BatchInferenceJobOutput -> BatchInferenceJobOutput -> Bool
$c== :: BatchInferenceJobOutput -> BatchInferenceJobOutput -> Bool
Prelude.Eq, ReadPrec [BatchInferenceJobOutput]
ReadPrec BatchInferenceJobOutput
Int -> ReadS BatchInferenceJobOutput
ReadS [BatchInferenceJobOutput]
(Int -> ReadS BatchInferenceJobOutput)
-> ReadS [BatchInferenceJobOutput]
-> ReadPrec BatchInferenceJobOutput
-> ReadPrec [BatchInferenceJobOutput]
-> Read BatchInferenceJobOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BatchInferenceJobOutput]
$creadListPrec :: ReadPrec [BatchInferenceJobOutput]
readPrec :: ReadPrec BatchInferenceJobOutput
$creadPrec :: ReadPrec BatchInferenceJobOutput
readList :: ReadS [BatchInferenceJobOutput]
$creadList :: ReadS [BatchInferenceJobOutput]
readsPrec :: Int -> ReadS BatchInferenceJobOutput
$creadsPrec :: Int -> ReadS BatchInferenceJobOutput
Prelude.Read, Int -> BatchInferenceJobOutput -> ShowS
[BatchInferenceJobOutput] -> ShowS
BatchInferenceJobOutput -> String
(Int -> BatchInferenceJobOutput -> ShowS)
-> (BatchInferenceJobOutput -> String)
-> ([BatchInferenceJobOutput] -> ShowS)
-> Show BatchInferenceJobOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BatchInferenceJobOutput] -> ShowS
$cshowList :: [BatchInferenceJobOutput] -> ShowS
show :: BatchInferenceJobOutput -> String
$cshow :: BatchInferenceJobOutput -> String
showsPrec :: Int -> BatchInferenceJobOutput -> ShowS
$cshowsPrec :: Int -> BatchInferenceJobOutput -> ShowS
Prelude.Show, (forall x.
 BatchInferenceJobOutput -> Rep BatchInferenceJobOutput x)
-> (forall x.
    Rep BatchInferenceJobOutput x -> BatchInferenceJobOutput)
-> Generic BatchInferenceJobOutput
forall x. Rep BatchInferenceJobOutput x -> BatchInferenceJobOutput
forall x. BatchInferenceJobOutput -> Rep BatchInferenceJobOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BatchInferenceJobOutput x -> BatchInferenceJobOutput
$cfrom :: forall x. BatchInferenceJobOutput -> Rep BatchInferenceJobOutput x
Prelude.Generic)

-- |
-- Create a value of 'BatchInferenceJobOutput' 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', 'batchInferenceJobOutput_s3DataDestination' - Information on the Amazon S3 bucket in which the batch inference job\'s
-- output is stored.
newBatchInferenceJobOutput ::
  -- | 's3DataDestination'
  S3DataConfig ->
  BatchInferenceJobOutput
newBatchInferenceJobOutput :: S3DataConfig -> BatchInferenceJobOutput
newBatchInferenceJobOutput S3DataConfig
pS3DataDestination_ =
  BatchInferenceJobOutput' :: S3DataConfig -> BatchInferenceJobOutput
BatchInferenceJobOutput'
    { $sel:s3DataDestination:BatchInferenceJobOutput' :: S3DataConfig
s3DataDestination =
        S3DataConfig
pS3DataDestination_
    }

-- | Information on the Amazon S3 bucket in which the batch inference job\'s
-- output is stored.
batchInferenceJobOutput_s3DataDestination :: Lens.Lens' BatchInferenceJobOutput S3DataConfig
batchInferenceJobOutput_s3DataDestination :: (S3DataConfig -> f S3DataConfig)
-> BatchInferenceJobOutput -> f BatchInferenceJobOutput
batchInferenceJobOutput_s3DataDestination = (BatchInferenceJobOutput -> S3DataConfig)
-> (BatchInferenceJobOutput
    -> S3DataConfig -> BatchInferenceJobOutput)
-> Lens
     BatchInferenceJobOutput
     BatchInferenceJobOutput
     S3DataConfig
     S3DataConfig
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BatchInferenceJobOutput' {S3DataConfig
s3DataDestination :: S3DataConfig
$sel:s3DataDestination:BatchInferenceJobOutput' :: BatchInferenceJobOutput -> S3DataConfig
s3DataDestination} -> S3DataConfig
s3DataDestination) (\s :: BatchInferenceJobOutput
s@BatchInferenceJobOutput' {} S3DataConfig
a -> BatchInferenceJobOutput
s {$sel:s3DataDestination:BatchInferenceJobOutput' :: S3DataConfig
s3DataDestination = S3DataConfig
a} :: BatchInferenceJobOutput)

instance Core.FromJSON BatchInferenceJobOutput where
  parseJSON :: Value -> Parser BatchInferenceJobOutput
parseJSON =
    String
-> (Object -> Parser BatchInferenceJobOutput)
-> Value
-> Parser BatchInferenceJobOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BatchInferenceJobOutput"
      ( \Object
x ->
          S3DataConfig -> BatchInferenceJobOutput
BatchInferenceJobOutput'
            (S3DataConfig -> BatchInferenceJobOutput)
-> Parser S3DataConfig -> Parser BatchInferenceJobOutput
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 BatchInferenceJobOutput

instance Prelude.NFData BatchInferenceJobOutput

instance Core.ToJSON BatchInferenceJobOutput where
  toJSON :: BatchInferenceJobOutput -> Value
toJSON BatchInferenceJobOutput' {S3DataConfig
s3DataDestination :: S3DataConfig
$sel:s3DataDestination:BatchInferenceJobOutput' :: BatchInferenceJobOutput -> 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)
          ]
      )