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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
    { $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 :: Lens' BatchInferenceJobOutput S3DataConfig
batchInferenceJobOutput_s3DataDestination = 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 Data.FromJSON BatchInferenceJobOutput where
  parseJSON :: Value -> Parser BatchInferenceJobOutput
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BatchInferenceJobOutput"
      ( \Object
x ->
          S3DataConfig -> BatchInferenceJobOutput
BatchInferenceJobOutput'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"s3DataDestination")
      )

instance Prelude.Hashable BatchInferenceJobOutput where
  hashWithSalt :: Int -> BatchInferenceJobOutput -> Int
hashWithSalt Int
_salt BatchInferenceJobOutput' {S3DataConfig
s3DataDestination :: S3DataConfig
$sel:s3DataDestination:BatchInferenceJobOutput' :: BatchInferenceJobOutput -> S3DataConfig
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` S3DataConfig
s3DataDestination

instance Prelude.NFData BatchInferenceJobOutput where
  rnf :: BatchInferenceJobOutput -> ()
rnf BatchInferenceJobOutput' {S3DataConfig
s3DataDestination :: S3DataConfig
$sel:s3DataDestination:BatchInferenceJobOutput' :: BatchInferenceJobOutput -> S3DataConfig
..} =
    forall a. NFData a => a -> ()
Prelude.rnf S3DataConfig
s3DataDestination

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