{-# 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.SageMaker.Types.TransformJobDefinition
-- 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.SageMaker.Types.TransformJobDefinition where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.BatchStrategy
import Amazonka.SageMaker.Types.TransformInput
import Amazonka.SageMaker.Types.TransformOutput
import Amazonka.SageMaker.Types.TransformResources

-- | Defines the input needed to run a transform job using the inference
-- specification specified in the algorithm.
--
-- /See:/ 'newTransformJobDefinition' smart constructor.
data TransformJobDefinition = TransformJobDefinition'
  { -- | A string that determines the number of records included in a single
    -- mini-batch.
    --
    -- @SingleRecord@ means only one record is used per mini-batch.
    -- @MultiRecord@ means a mini-batch is set to contain as many records that
    -- can fit within the @MaxPayloadInMB@ limit.
    TransformJobDefinition -> Maybe BatchStrategy
batchStrategy :: Prelude.Maybe BatchStrategy,
    -- | The maximum payload size allowed, in MB. A payload is the data portion
    -- of a record (without metadata).
    TransformJobDefinition -> Maybe Natural
maxPayloadInMB :: Prelude.Maybe Prelude.Natural,
    -- | The environment variables to set in the Docker container. We support up
    -- to 16 key and values entries in the map.
    TransformJobDefinition -> Maybe (HashMap Text Text)
environment :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
    -- | The maximum number of parallel requests that can be sent to each
    -- instance in a transform job. The default value is 1.
    TransformJobDefinition -> Maybe Natural
maxConcurrentTransforms :: Prelude.Maybe Prelude.Natural,
    -- | A description of the input source and the way the transform job consumes
    -- it.
    TransformJobDefinition -> TransformInput
transformInput :: TransformInput,
    -- | Identifies the Amazon S3 location where you want Amazon SageMaker to
    -- save the results from the transform job.
    TransformJobDefinition -> TransformOutput
transformOutput :: TransformOutput,
    -- | Identifies the ML compute instances for the transform job.
    TransformJobDefinition -> TransformResources
transformResources :: TransformResources
  }
  deriving (TransformJobDefinition -> TransformJobDefinition -> Bool
(TransformJobDefinition -> TransformJobDefinition -> Bool)
-> (TransformJobDefinition -> TransformJobDefinition -> Bool)
-> Eq TransformJobDefinition
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransformJobDefinition -> TransformJobDefinition -> Bool
$c/= :: TransformJobDefinition -> TransformJobDefinition -> Bool
== :: TransformJobDefinition -> TransformJobDefinition -> Bool
$c== :: TransformJobDefinition -> TransformJobDefinition -> Bool
Prelude.Eq, ReadPrec [TransformJobDefinition]
ReadPrec TransformJobDefinition
Int -> ReadS TransformJobDefinition
ReadS [TransformJobDefinition]
(Int -> ReadS TransformJobDefinition)
-> ReadS [TransformJobDefinition]
-> ReadPrec TransformJobDefinition
-> ReadPrec [TransformJobDefinition]
-> Read TransformJobDefinition
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransformJobDefinition]
$creadListPrec :: ReadPrec [TransformJobDefinition]
readPrec :: ReadPrec TransformJobDefinition
$creadPrec :: ReadPrec TransformJobDefinition
readList :: ReadS [TransformJobDefinition]
$creadList :: ReadS [TransformJobDefinition]
readsPrec :: Int -> ReadS TransformJobDefinition
$creadsPrec :: Int -> ReadS TransformJobDefinition
Prelude.Read, Int -> TransformJobDefinition -> ShowS
[TransformJobDefinition] -> ShowS
TransformJobDefinition -> String
(Int -> TransformJobDefinition -> ShowS)
-> (TransformJobDefinition -> String)
-> ([TransformJobDefinition] -> ShowS)
-> Show TransformJobDefinition
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransformJobDefinition] -> ShowS
$cshowList :: [TransformJobDefinition] -> ShowS
show :: TransformJobDefinition -> String
$cshow :: TransformJobDefinition -> String
showsPrec :: Int -> TransformJobDefinition -> ShowS
$cshowsPrec :: Int -> TransformJobDefinition -> ShowS
Prelude.Show, (forall x. TransformJobDefinition -> Rep TransformJobDefinition x)
-> (forall x.
    Rep TransformJobDefinition x -> TransformJobDefinition)
-> Generic TransformJobDefinition
forall x. Rep TransformJobDefinition x -> TransformJobDefinition
forall x. TransformJobDefinition -> Rep TransformJobDefinition x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TransformJobDefinition x -> TransformJobDefinition
$cfrom :: forall x. TransformJobDefinition -> Rep TransformJobDefinition x
Prelude.Generic)

-- |
-- Create a value of 'TransformJobDefinition' 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:
--
-- 'batchStrategy', 'transformJobDefinition_batchStrategy' - A string that determines the number of records included in a single
-- mini-batch.
--
-- @SingleRecord@ means only one record is used per mini-batch.
-- @MultiRecord@ means a mini-batch is set to contain as many records that
-- can fit within the @MaxPayloadInMB@ limit.
--
-- 'maxPayloadInMB', 'transformJobDefinition_maxPayloadInMB' - The maximum payload size allowed, in MB. A payload is the data portion
-- of a record (without metadata).
--
-- 'environment', 'transformJobDefinition_environment' - The environment variables to set in the Docker container. We support up
-- to 16 key and values entries in the map.
--
-- 'maxConcurrentTransforms', 'transformJobDefinition_maxConcurrentTransforms' - The maximum number of parallel requests that can be sent to each
-- instance in a transform job. The default value is 1.
--
-- 'transformInput', 'transformJobDefinition_transformInput' - A description of the input source and the way the transform job consumes
-- it.
--
-- 'transformOutput', 'transformJobDefinition_transformOutput' - Identifies the Amazon S3 location where you want Amazon SageMaker to
-- save the results from the transform job.
--
-- 'transformResources', 'transformJobDefinition_transformResources' - Identifies the ML compute instances for the transform job.
newTransformJobDefinition ::
  -- | 'transformInput'
  TransformInput ->
  -- | 'transformOutput'
  TransformOutput ->
  -- | 'transformResources'
  TransformResources ->
  TransformJobDefinition
newTransformJobDefinition :: TransformInput
-> TransformOutput -> TransformResources -> TransformJobDefinition
newTransformJobDefinition
  TransformInput
pTransformInput_
  TransformOutput
pTransformOutput_
  TransformResources
pTransformResources_ =
    TransformJobDefinition' :: Maybe BatchStrategy
-> Maybe Natural
-> Maybe (HashMap Text Text)
-> Maybe Natural
-> TransformInput
-> TransformOutput
-> TransformResources
-> TransformJobDefinition
TransformJobDefinition'
      { $sel:batchStrategy:TransformJobDefinition' :: Maybe BatchStrategy
batchStrategy =
          Maybe BatchStrategy
forall a. Maybe a
Prelude.Nothing,
        $sel:maxPayloadInMB:TransformJobDefinition' :: Maybe Natural
maxPayloadInMB = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:environment:TransformJobDefinition' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
        $sel:maxConcurrentTransforms:TransformJobDefinition' :: Maybe Natural
maxConcurrentTransforms = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
        $sel:transformInput:TransformJobDefinition' :: TransformInput
transformInput = TransformInput
pTransformInput_,
        $sel:transformOutput:TransformJobDefinition' :: TransformOutput
transformOutput = TransformOutput
pTransformOutput_,
        $sel:transformResources:TransformJobDefinition' :: TransformResources
transformResources = TransformResources
pTransformResources_
      }

-- | A string that determines the number of records included in a single
-- mini-batch.
--
-- @SingleRecord@ means only one record is used per mini-batch.
-- @MultiRecord@ means a mini-batch is set to contain as many records that
-- can fit within the @MaxPayloadInMB@ limit.
transformJobDefinition_batchStrategy :: Lens.Lens' TransformJobDefinition (Prelude.Maybe BatchStrategy)
transformJobDefinition_batchStrategy :: (Maybe BatchStrategy -> f (Maybe BatchStrategy))
-> TransformJobDefinition -> f TransformJobDefinition
transformJobDefinition_batchStrategy = (TransformJobDefinition -> Maybe BatchStrategy)
-> (TransformJobDefinition
    -> Maybe BatchStrategy -> TransformJobDefinition)
-> Lens
     TransformJobDefinition
     TransformJobDefinition
     (Maybe BatchStrategy)
     (Maybe BatchStrategy)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformJobDefinition' {Maybe BatchStrategy
batchStrategy :: Maybe BatchStrategy
$sel:batchStrategy:TransformJobDefinition' :: TransformJobDefinition -> Maybe BatchStrategy
batchStrategy} -> Maybe BatchStrategy
batchStrategy) (\s :: TransformJobDefinition
s@TransformJobDefinition' {} Maybe BatchStrategy
a -> TransformJobDefinition
s {$sel:batchStrategy:TransformJobDefinition' :: Maybe BatchStrategy
batchStrategy = Maybe BatchStrategy
a} :: TransformJobDefinition)

-- | The maximum payload size allowed, in MB. A payload is the data portion
-- of a record (without metadata).
transformJobDefinition_maxPayloadInMB :: Lens.Lens' TransformJobDefinition (Prelude.Maybe Prelude.Natural)
transformJobDefinition_maxPayloadInMB :: (Maybe Natural -> f (Maybe Natural))
-> TransformJobDefinition -> f TransformJobDefinition
transformJobDefinition_maxPayloadInMB = (TransformJobDefinition -> Maybe Natural)
-> (TransformJobDefinition
    -> Maybe Natural -> TransformJobDefinition)
-> Lens
     TransformJobDefinition
     TransformJobDefinition
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformJobDefinition' {Maybe Natural
maxPayloadInMB :: Maybe Natural
$sel:maxPayloadInMB:TransformJobDefinition' :: TransformJobDefinition -> Maybe Natural
maxPayloadInMB} -> Maybe Natural
maxPayloadInMB) (\s :: TransformJobDefinition
s@TransformJobDefinition' {} Maybe Natural
a -> TransformJobDefinition
s {$sel:maxPayloadInMB:TransformJobDefinition' :: Maybe Natural
maxPayloadInMB = Maybe Natural
a} :: TransformJobDefinition)

-- | The environment variables to set in the Docker container. We support up
-- to 16 key and values entries in the map.
transformJobDefinition_environment :: Lens.Lens' TransformJobDefinition (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
transformJobDefinition_environment :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TransformJobDefinition -> f TransformJobDefinition
transformJobDefinition_environment = (TransformJobDefinition -> Maybe (HashMap Text Text))
-> (TransformJobDefinition
    -> Maybe (HashMap Text Text) -> TransformJobDefinition)
-> Lens
     TransformJobDefinition
     TransformJobDefinition
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformJobDefinition' {Maybe (HashMap Text Text)
environment :: Maybe (HashMap Text Text)
$sel:environment:TransformJobDefinition' :: TransformJobDefinition -> Maybe (HashMap Text Text)
environment} -> Maybe (HashMap Text Text)
environment) (\s :: TransformJobDefinition
s@TransformJobDefinition' {} Maybe (HashMap Text Text)
a -> TransformJobDefinition
s {$sel:environment:TransformJobDefinition' :: Maybe (HashMap Text Text)
environment = Maybe (HashMap Text Text)
a} :: TransformJobDefinition) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
 -> TransformJobDefinition -> f TransformJobDefinition)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
    -> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> TransformJobDefinition
-> f TransformJobDefinition
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
-> Iso
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
     (Maybe (HashMap Text Text))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
  (HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The maximum number of parallel requests that can be sent to each
-- instance in a transform job. The default value is 1.
transformJobDefinition_maxConcurrentTransforms :: Lens.Lens' TransformJobDefinition (Prelude.Maybe Prelude.Natural)
transformJobDefinition_maxConcurrentTransforms :: (Maybe Natural -> f (Maybe Natural))
-> TransformJobDefinition -> f TransformJobDefinition
transformJobDefinition_maxConcurrentTransforms = (TransformJobDefinition -> Maybe Natural)
-> (TransformJobDefinition
    -> Maybe Natural -> TransformJobDefinition)
-> Lens
     TransformJobDefinition
     TransformJobDefinition
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformJobDefinition' {Maybe Natural
maxConcurrentTransforms :: Maybe Natural
$sel:maxConcurrentTransforms:TransformJobDefinition' :: TransformJobDefinition -> Maybe Natural
maxConcurrentTransforms} -> Maybe Natural
maxConcurrentTransforms) (\s :: TransformJobDefinition
s@TransformJobDefinition' {} Maybe Natural
a -> TransformJobDefinition
s {$sel:maxConcurrentTransforms:TransformJobDefinition' :: Maybe Natural
maxConcurrentTransforms = Maybe Natural
a} :: TransformJobDefinition)

-- | A description of the input source and the way the transform job consumes
-- it.
transformJobDefinition_transformInput :: Lens.Lens' TransformJobDefinition TransformInput
transformJobDefinition_transformInput :: (TransformInput -> f TransformInput)
-> TransformJobDefinition -> f TransformJobDefinition
transformJobDefinition_transformInput = (TransformJobDefinition -> TransformInput)
-> (TransformJobDefinition
    -> TransformInput -> TransformJobDefinition)
-> Lens
     TransformJobDefinition
     TransformJobDefinition
     TransformInput
     TransformInput
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformJobDefinition' {TransformInput
transformInput :: TransformInput
$sel:transformInput:TransformJobDefinition' :: TransformJobDefinition -> TransformInput
transformInput} -> TransformInput
transformInput) (\s :: TransformJobDefinition
s@TransformJobDefinition' {} TransformInput
a -> TransformJobDefinition
s {$sel:transformInput:TransformJobDefinition' :: TransformInput
transformInput = TransformInput
a} :: TransformJobDefinition)

-- | Identifies the Amazon S3 location where you want Amazon SageMaker to
-- save the results from the transform job.
transformJobDefinition_transformOutput :: Lens.Lens' TransformJobDefinition TransformOutput
transformJobDefinition_transformOutput :: (TransformOutput -> f TransformOutput)
-> TransformJobDefinition -> f TransformJobDefinition
transformJobDefinition_transformOutput = (TransformJobDefinition -> TransformOutput)
-> (TransformJobDefinition
    -> TransformOutput -> TransformJobDefinition)
-> Lens
     TransformJobDefinition
     TransformJobDefinition
     TransformOutput
     TransformOutput
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformJobDefinition' {TransformOutput
transformOutput :: TransformOutput
$sel:transformOutput:TransformJobDefinition' :: TransformJobDefinition -> TransformOutput
transformOutput} -> TransformOutput
transformOutput) (\s :: TransformJobDefinition
s@TransformJobDefinition' {} TransformOutput
a -> TransformJobDefinition
s {$sel:transformOutput:TransformJobDefinition' :: TransformOutput
transformOutput = TransformOutput
a} :: TransformJobDefinition)

-- | Identifies the ML compute instances for the transform job.
transformJobDefinition_transformResources :: Lens.Lens' TransformJobDefinition TransformResources
transformJobDefinition_transformResources :: (TransformResources -> f TransformResources)
-> TransformJobDefinition -> f TransformJobDefinition
transformJobDefinition_transformResources = (TransformJobDefinition -> TransformResources)
-> (TransformJobDefinition
    -> TransformResources -> TransformJobDefinition)
-> Lens
     TransformJobDefinition
     TransformJobDefinition
     TransformResources
     TransformResources
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformJobDefinition' {TransformResources
transformResources :: TransformResources
$sel:transformResources:TransformJobDefinition' :: TransformJobDefinition -> TransformResources
transformResources} -> TransformResources
transformResources) (\s :: TransformJobDefinition
s@TransformJobDefinition' {} TransformResources
a -> TransformJobDefinition
s {$sel:transformResources:TransformJobDefinition' :: TransformResources
transformResources = TransformResources
a} :: TransformJobDefinition)

instance Core.FromJSON TransformJobDefinition where
  parseJSON :: Value -> Parser TransformJobDefinition
parseJSON =
    String
-> (Object -> Parser TransformJobDefinition)
-> Value
-> Parser TransformJobDefinition
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TransformJobDefinition"
      ( \Object
x ->
          Maybe BatchStrategy
-> Maybe Natural
-> Maybe (HashMap Text Text)
-> Maybe Natural
-> TransformInput
-> TransformOutput
-> TransformResources
-> TransformJobDefinition
TransformJobDefinition'
            (Maybe BatchStrategy
 -> Maybe Natural
 -> Maybe (HashMap Text Text)
 -> Maybe Natural
 -> TransformInput
 -> TransformOutput
 -> TransformResources
 -> TransformJobDefinition)
-> Parser (Maybe BatchStrategy)
-> Parser
     (Maybe Natural
      -> Maybe (HashMap Text Text)
      -> Maybe Natural
      -> TransformInput
      -> TransformOutput
      -> TransformResources
      -> TransformJobDefinition)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe BatchStrategy)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"BatchStrategy")
            Parser
  (Maybe Natural
   -> Maybe (HashMap Text Text)
   -> Maybe Natural
   -> TransformInput
   -> TransformOutput
   -> TransformResources
   -> TransformJobDefinition)
-> Parser (Maybe Natural)
-> Parser
     (Maybe (HashMap Text Text)
      -> Maybe Natural
      -> TransformInput
      -> TransformOutput
      -> TransformResources
      -> TransformJobDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxPayloadInMB")
            Parser
  (Maybe (HashMap Text Text)
   -> Maybe Natural
   -> TransformInput
   -> TransformOutput
   -> TransformResources
   -> TransformJobDefinition)
-> Parser (Maybe (HashMap Text Text))
-> Parser
     (Maybe Natural
      -> TransformInput
      -> TransformOutput
      -> TransformResources
      -> TransformJobDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Environment" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Natural
   -> TransformInput
   -> TransformOutput
   -> TransformResources
   -> TransformJobDefinition)
-> Parser (Maybe Natural)
-> Parser
     (TransformInput
      -> TransformOutput -> TransformResources -> TransformJobDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"MaxConcurrentTransforms")
            Parser
  (TransformInput
   -> TransformOutput -> TransformResources -> TransformJobDefinition)
-> Parser TransformInput
-> Parser
     (TransformOutput -> TransformResources -> TransformJobDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser TransformInput
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TransformInput")
            Parser
  (TransformOutput -> TransformResources -> TransformJobDefinition)
-> Parser TransformOutput
-> Parser (TransformResources -> TransformJobDefinition)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser TransformOutput
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TransformOutput")
            Parser (TransformResources -> TransformJobDefinition)
-> Parser TransformResources -> Parser TransformJobDefinition
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser TransformResources
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"TransformResources")
      )

instance Prelude.Hashable TransformJobDefinition

instance Prelude.NFData TransformJobDefinition

instance Core.ToJSON TransformJobDefinition where
  toJSON :: TransformJobDefinition -> Value
toJSON TransformJobDefinition' {Maybe Natural
Maybe (HashMap Text Text)
Maybe BatchStrategy
TransformOutput
TransformResources
TransformInput
transformResources :: TransformResources
transformOutput :: TransformOutput
transformInput :: TransformInput
maxConcurrentTransforms :: Maybe Natural
environment :: Maybe (HashMap Text Text)
maxPayloadInMB :: Maybe Natural
batchStrategy :: Maybe BatchStrategy
$sel:transformResources:TransformJobDefinition' :: TransformJobDefinition -> TransformResources
$sel:transformOutput:TransformJobDefinition' :: TransformJobDefinition -> TransformOutput
$sel:transformInput:TransformJobDefinition' :: TransformJobDefinition -> TransformInput
$sel:maxConcurrentTransforms:TransformJobDefinition' :: TransformJobDefinition -> Maybe Natural
$sel:environment:TransformJobDefinition' :: TransformJobDefinition -> Maybe (HashMap Text Text)
$sel:maxPayloadInMB:TransformJobDefinition' :: TransformJobDefinition -> Maybe Natural
$sel:batchStrategy:TransformJobDefinition' :: TransformJobDefinition -> Maybe BatchStrategy
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"BatchStrategy" Text -> BatchStrategy -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (BatchStrategy -> Pair) -> Maybe BatchStrategy -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe BatchStrategy
batchStrategy,
            (Text
"MaxPayloadInMB" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxPayloadInMB,
            (Text
"Environment" Text -> HashMap Text Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text Text -> Pair)
-> Maybe (HashMap Text Text) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text Text)
environment,
            (Text
"MaxConcurrentTransforms" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
maxConcurrentTransforms,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TransformInput" Text -> TransformInput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TransformInput
transformInput),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TransformOutput" Text -> TransformOutput -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TransformOutput
transformOutput),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"TransformResources" Text -> TransformResources -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TransformResources
transformResources)
          ]
      )