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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.CompressionType
import Amazonka.SageMaker.Types.DataSource
import Amazonka.SageMaker.Types.RecordWrapper
import Amazonka.SageMaker.Types.ShuffleConfig
import Amazonka.SageMaker.Types.TrainingInputMode

-- | A channel is a named input source that training algorithms can consume.
--
-- /See:/ 'newChannel' smart constructor.
data Channel = Channel'
  { -- | A configuration for a shuffle option for input data in a channel. If you
    -- use @S3Prefix@ for @S3DataType@, this shuffles the results of the S3 key
    -- prefix matches. If you use @ManifestFile@, the order of the S3 object
    -- references in the @ManifestFile@ is shuffled. If you use
    -- @AugmentedManifestFile@, the order of the JSON lines in the
    -- @AugmentedManifestFile@ is shuffled. The shuffling order is determined
    -- using the @Seed@ value.
    --
    -- For Pipe input mode, shuffling is done at the start of every epoch. With
    -- large datasets this ensures that the order of the training data is
    -- different for each epoch, it helps reduce bias and possible overfitting.
    -- In a multi-node training job when ShuffleConfig is combined with
    -- @S3DataDistributionType@ of @ShardedByS3Key@, the data is shuffled
    -- across nodes so that the content sent to a particular node on the first
    -- epoch might be sent to a different node on the second epoch.
    Channel -> Maybe ShuffleConfig
shuffleConfig :: Prelude.Maybe ShuffleConfig,
    -- | Specify RecordIO as the value when input data is in raw format but the
    -- training algorithm requires the RecordIO format. In this case, Amazon
    -- SageMaker wraps each individual S3 object in a RecordIO record. If the
    -- input data is already in RecordIO format, you don\'t need to set this
    -- attribute. For more information, see
    -- <https://mxnet.apache.org/api/architecture/note_data_loading#data-format Create a Dataset Using RecordIO>.
    --
    -- In File mode, leave this field unset or set it to None.
    Channel -> Maybe RecordWrapper
recordWrapperType :: Prelude.Maybe RecordWrapper,
    -- | (Optional) The input mode to use for the data channel in a training job.
    -- If you don\'t set a value for @InputMode@, Amazon SageMaker uses the
    -- value set for @TrainingInputMode@. Use this parameter to override the
    -- @TrainingInputMode@ setting in a AlgorithmSpecification request when you
    -- have a channel that needs a different input mode from the training
    -- job\'s general setting. To download the data from Amazon Simple Storage
    -- Service (Amazon S3) to the provisioned ML storage volume, and mount the
    -- directory to a Docker volume, use @File@ input mode. To stream data
    -- directly from Amazon S3 to the container, choose @Pipe@ input mode.
    --
    -- To use a model for incremental training, choose @File@ input model.
    Channel -> Maybe TrainingInputMode
inputMode :: Prelude.Maybe TrainingInputMode,
    -- | If training data is compressed, the compression type. The default value
    -- is @None@. @CompressionType@ is used only in Pipe input mode. In File
    -- mode, leave this field unset or set it to None.
    Channel -> Maybe CompressionType
compressionType :: Prelude.Maybe CompressionType,
    -- | The MIME type of the data.
    Channel -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
    -- | The name of the channel.
    Channel -> Text
channelName :: Prelude.Text,
    -- | The location of the channel data.
    Channel -> DataSource
dataSource :: DataSource
  }
  deriving (Channel -> Channel -> Bool
(Channel -> Channel -> Bool)
-> (Channel -> Channel -> Bool) -> Eq Channel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Channel -> Channel -> Bool
$c/= :: Channel -> Channel -> Bool
== :: Channel -> Channel -> Bool
$c== :: Channel -> Channel -> Bool
Prelude.Eq, ReadPrec [Channel]
ReadPrec Channel
Int -> ReadS Channel
ReadS [Channel]
(Int -> ReadS Channel)
-> ReadS [Channel]
-> ReadPrec Channel
-> ReadPrec [Channel]
-> Read Channel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Channel]
$creadListPrec :: ReadPrec [Channel]
readPrec :: ReadPrec Channel
$creadPrec :: ReadPrec Channel
readList :: ReadS [Channel]
$creadList :: ReadS [Channel]
readsPrec :: Int -> ReadS Channel
$creadsPrec :: Int -> ReadS Channel
Prelude.Read, Int -> Channel -> ShowS
[Channel] -> ShowS
Channel -> String
(Int -> Channel -> ShowS)
-> (Channel -> String) -> ([Channel] -> ShowS) -> Show Channel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Channel] -> ShowS
$cshowList :: [Channel] -> ShowS
show :: Channel -> String
$cshow :: Channel -> String
showsPrec :: Int -> Channel -> ShowS
$cshowsPrec :: Int -> Channel -> ShowS
Prelude.Show, (forall x. Channel -> Rep Channel x)
-> (forall x. Rep Channel x -> Channel) -> Generic Channel
forall x. Rep Channel x -> Channel
forall x. Channel -> Rep Channel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Channel x -> Channel
$cfrom :: forall x. Channel -> Rep Channel x
Prelude.Generic)

-- |
-- Create a value of 'Channel' 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:
--
-- 'shuffleConfig', 'channel_shuffleConfig' - A configuration for a shuffle option for input data in a channel. If you
-- use @S3Prefix@ for @S3DataType@, this shuffles the results of the S3 key
-- prefix matches. If you use @ManifestFile@, the order of the S3 object
-- references in the @ManifestFile@ is shuffled. If you use
-- @AugmentedManifestFile@, the order of the JSON lines in the
-- @AugmentedManifestFile@ is shuffled. The shuffling order is determined
-- using the @Seed@ value.
--
-- For Pipe input mode, shuffling is done at the start of every epoch. With
-- large datasets this ensures that the order of the training data is
-- different for each epoch, it helps reduce bias and possible overfitting.
-- In a multi-node training job when ShuffleConfig is combined with
-- @S3DataDistributionType@ of @ShardedByS3Key@, the data is shuffled
-- across nodes so that the content sent to a particular node on the first
-- epoch might be sent to a different node on the second epoch.
--
-- 'recordWrapperType', 'channel_recordWrapperType' - Specify RecordIO as the value when input data is in raw format but the
-- training algorithm requires the RecordIO format. In this case, Amazon
-- SageMaker wraps each individual S3 object in a RecordIO record. If the
-- input data is already in RecordIO format, you don\'t need to set this
-- attribute. For more information, see
-- <https://mxnet.apache.org/api/architecture/note_data_loading#data-format Create a Dataset Using RecordIO>.
--
-- In File mode, leave this field unset or set it to None.
--
-- 'inputMode', 'channel_inputMode' - (Optional) The input mode to use for the data channel in a training job.
-- If you don\'t set a value for @InputMode@, Amazon SageMaker uses the
-- value set for @TrainingInputMode@. Use this parameter to override the
-- @TrainingInputMode@ setting in a AlgorithmSpecification request when you
-- have a channel that needs a different input mode from the training
-- job\'s general setting. To download the data from Amazon Simple Storage
-- Service (Amazon S3) to the provisioned ML storage volume, and mount the
-- directory to a Docker volume, use @File@ input mode. To stream data
-- directly from Amazon S3 to the container, choose @Pipe@ input mode.
--
-- To use a model for incremental training, choose @File@ input model.
--
-- 'compressionType', 'channel_compressionType' - If training data is compressed, the compression type. The default value
-- is @None@. @CompressionType@ is used only in Pipe input mode. In File
-- mode, leave this field unset or set it to None.
--
-- 'contentType', 'channel_contentType' - The MIME type of the data.
--
-- 'channelName', 'channel_channelName' - The name of the channel.
--
-- 'dataSource', 'channel_dataSource' - The location of the channel data.
newChannel ::
  -- | 'channelName'
  Prelude.Text ->
  -- | 'dataSource'
  DataSource ->
  Channel
newChannel :: Text -> DataSource -> Channel
newChannel Text
pChannelName_ DataSource
pDataSource_ =
  Channel' :: Maybe ShuffleConfig
-> Maybe RecordWrapper
-> Maybe TrainingInputMode
-> Maybe CompressionType
-> Maybe Text
-> Text
-> DataSource
-> Channel
Channel'
    { $sel:shuffleConfig:Channel' :: Maybe ShuffleConfig
shuffleConfig = Maybe ShuffleConfig
forall a. Maybe a
Prelude.Nothing,
      $sel:recordWrapperType:Channel' :: Maybe RecordWrapper
recordWrapperType = Maybe RecordWrapper
forall a. Maybe a
Prelude.Nothing,
      $sel:inputMode:Channel' :: Maybe TrainingInputMode
inputMode = Maybe TrainingInputMode
forall a. Maybe a
Prelude.Nothing,
      $sel:compressionType:Channel' :: Maybe CompressionType
compressionType = Maybe CompressionType
forall a. Maybe a
Prelude.Nothing,
      $sel:contentType:Channel' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:channelName:Channel' :: Text
channelName = Text
pChannelName_,
      $sel:dataSource:Channel' :: DataSource
dataSource = DataSource
pDataSource_
    }

-- | A configuration for a shuffle option for input data in a channel. If you
-- use @S3Prefix@ for @S3DataType@, this shuffles the results of the S3 key
-- prefix matches. If you use @ManifestFile@, the order of the S3 object
-- references in the @ManifestFile@ is shuffled. If you use
-- @AugmentedManifestFile@, the order of the JSON lines in the
-- @AugmentedManifestFile@ is shuffled. The shuffling order is determined
-- using the @Seed@ value.
--
-- For Pipe input mode, shuffling is done at the start of every epoch. With
-- large datasets this ensures that the order of the training data is
-- different for each epoch, it helps reduce bias and possible overfitting.
-- In a multi-node training job when ShuffleConfig is combined with
-- @S3DataDistributionType@ of @ShardedByS3Key@, the data is shuffled
-- across nodes so that the content sent to a particular node on the first
-- epoch might be sent to a different node on the second epoch.
channel_shuffleConfig :: Lens.Lens' Channel (Prelude.Maybe ShuffleConfig)
channel_shuffleConfig :: (Maybe ShuffleConfig -> f (Maybe ShuffleConfig))
-> Channel -> f Channel
channel_shuffleConfig = (Channel -> Maybe ShuffleConfig)
-> (Channel -> Maybe ShuffleConfig -> Channel)
-> Lens Channel Channel (Maybe ShuffleConfig) (Maybe ShuffleConfig)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe ShuffleConfig
shuffleConfig :: Maybe ShuffleConfig
$sel:shuffleConfig:Channel' :: Channel -> Maybe ShuffleConfig
shuffleConfig} -> Maybe ShuffleConfig
shuffleConfig) (\s :: Channel
s@Channel' {} Maybe ShuffleConfig
a -> Channel
s {$sel:shuffleConfig:Channel' :: Maybe ShuffleConfig
shuffleConfig = Maybe ShuffleConfig
a} :: Channel)

-- | Specify RecordIO as the value when input data is in raw format but the
-- training algorithm requires the RecordIO format. In this case, Amazon
-- SageMaker wraps each individual S3 object in a RecordIO record. If the
-- input data is already in RecordIO format, you don\'t need to set this
-- attribute. For more information, see
-- <https://mxnet.apache.org/api/architecture/note_data_loading#data-format Create a Dataset Using RecordIO>.
--
-- In File mode, leave this field unset or set it to None.
channel_recordWrapperType :: Lens.Lens' Channel (Prelude.Maybe RecordWrapper)
channel_recordWrapperType :: (Maybe RecordWrapper -> f (Maybe RecordWrapper))
-> Channel -> f Channel
channel_recordWrapperType = (Channel -> Maybe RecordWrapper)
-> (Channel -> Maybe RecordWrapper -> Channel)
-> Lens Channel Channel (Maybe RecordWrapper) (Maybe RecordWrapper)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe RecordWrapper
recordWrapperType :: Maybe RecordWrapper
$sel:recordWrapperType:Channel' :: Channel -> Maybe RecordWrapper
recordWrapperType} -> Maybe RecordWrapper
recordWrapperType) (\s :: Channel
s@Channel' {} Maybe RecordWrapper
a -> Channel
s {$sel:recordWrapperType:Channel' :: Maybe RecordWrapper
recordWrapperType = Maybe RecordWrapper
a} :: Channel)

-- | (Optional) The input mode to use for the data channel in a training job.
-- If you don\'t set a value for @InputMode@, Amazon SageMaker uses the
-- value set for @TrainingInputMode@. Use this parameter to override the
-- @TrainingInputMode@ setting in a AlgorithmSpecification request when you
-- have a channel that needs a different input mode from the training
-- job\'s general setting. To download the data from Amazon Simple Storage
-- Service (Amazon S3) to the provisioned ML storage volume, and mount the
-- directory to a Docker volume, use @File@ input mode. To stream data
-- directly from Amazon S3 to the container, choose @Pipe@ input mode.
--
-- To use a model for incremental training, choose @File@ input model.
channel_inputMode :: Lens.Lens' Channel (Prelude.Maybe TrainingInputMode)
channel_inputMode :: (Maybe TrainingInputMode -> f (Maybe TrainingInputMode))
-> Channel -> f Channel
channel_inputMode = (Channel -> Maybe TrainingInputMode)
-> (Channel -> Maybe TrainingInputMode -> Channel)
-> Lens
     Channel Channel (Maybe TrainingInputMode) (Maybe TrainingInputMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe TrainingInputMode
inputMode :: Maybe TrainingInputMode
$sel:inputMode:Channel' :: Channel -> Maybe TrainingInputMode
inputMode} -> Maybe TrainingInputMode
inputMode) (\s :: Channel
s@Channel' {} Maybe TrainingInputMode
a -> Channel
s {$sel:inputMode:Channel' :: Maybe TrainingInputMode
inputMode = Maybe TrainingInputMode
a} :: Channel)

-- | If training data is compressed, the compression type. The default value
-- is @None@. @CompressionType@ is used only in Pipe input mode. In File
-- mode, leave this field unset or set it to None.
channel_compressionType :: Lens.Lens' Channel (Prelude.Maybe CompressionType)
channel_compressionType :: (Maybe CompressionType -> f (Maybe CompressionType))
-> Channel -> f Channel
channel_compressionType = (Channel -> Maybe CompressionType)
-> (Channel -> Maybe CompressionType -> Channel)
-> Lens
     Channel Channel (Maybe CompressionType) (Maybe CompressionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe CompressionType
compressionType :: Maybe CompressionType
$sel:compressionType:Channel' :: Channel -> Maybe CompressionType
compressionType} -> Maybe CompressionType
compressionType) (\s :: Channel
s@Channel' {} Maybe CompressionType
a -> Channel
s {$sel:compressionType:Channel' :: Maybe CompressionType
compressionType = Maybe CompressionType
a} :: Channel)

-- | The MIME type of the data.
channel_contentType :: Lens.Lens' Channel (Prelude.Maybe Prelude.Text)
channel_contentType :: (Maybe Text -> f (Maybe Text)) -> Channel -> f Channel
channel_contentType = (Channel -> Maybe Text)
-> (Channel -> Maybe Text -> Channel)
-> Lens Channel Channel (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe Text
contentType :: Maybe Text
$sel:contentType:Channel' :: Channel -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: Channel
s@Channel' {} Maybe Text
a -> Channel
s {$sel:contentType:Channel' :: Maybe Text
contentType = Maybe Text
a} :: Channel)

-- | The name of the channel.
channel_channelName :: Lens.Lens' Channel Prelude.Text
channel_channelName :: (Text -> f Text) -> Channel -> f Channel
channel_channelName = (Channel -> Text)
-> (Channel -> Text -> Channel) -> Lens Channel Channel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Text
channelName :: Text
$sel:channelName:Channel' :: Channel -> Text
channelName} -> Text
channelName) (\s :: Channel
s@Channel' {} Text
a -> Channel
s {$sel:channelName:Channel' :: Text
channelName = Text
a} :: Channel)

-- | The location of the channel data.
channel_dataSource :: Lens.Lens' Channel DataSource
channel_dataSource :: (DataSource -> f DataSource) -> Channel -> f Channel
channel_dataSource = (Channel -> DataSource)
-> (Channel -> DataSource -> Channel)
-> Lens Channel Channel DataSource DataSource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {DataSource
dataSource :: DataSource
$sel:dataSource:Channel' :: Channel -> DataSource
dataSource} -> DataSource
dataSource) (\s :: Channel
s@Channel' {} DataSource
a -> Channel
s {$sel:dataSource:Channel' :: DataSource
dataSource = DataSource
a} :: Channel)

instance Core.FromJSON Channel where
  parseJSON :: Value -> Parser Channel
parseJSON =
    String -> (Object -> Parser Channel) -> Value -> Parser Channel
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Channel"
      ( \Object
x ->
          Maybe ShuffleConfig
-> Maybe RecordWrapper
-> Maybe TrainingInputMode
-> Maybe CompressionType
-> Maybe Text
-> Text
-> DataSource
-> Channel
Channel'
            (Maybe ShuffleConfig
 -> Maybe RecordWrapper
 -> Maybe TrainingInputMode
 -> Maybe CompressionType
 -> Maybe Text
 -> Text
 -> DataSource
 -> Channel)
-> Parser (Maybe ShuffleConfig)
-> Parser
     (Maybe RecordWrapper
      -> Maybe TrainingInputMode
      -> Maybe CompressionType
      -> Maybe Text
      -> Text
      -> DataSource
      -> Channel)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe ShuffleConfig)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ShuffleConfig")
            Parser
  (Maybe RecordWrapper
   -> Maybe TrainingInputMode
   -> Maybe CompressionType
   -> Maybe Text
   -> Text
   -> DataSource
   -> Channel)
-> Parser (Maybe RecordWrapper)
-> Parser
     (Maybe TrainingInputMode
      -> Maybe CompressionType
      -> Maybe Text
      -> Text
      -> DataSource
      -> Channel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RecordWrapper)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RecordWrapperType")
            Parser
  (Maybe TrainingInputMode
   -> Maybe CompressionType
   -> Maybe Text
   -> Text
   -> DataSource
   -> Channel)
-> Parser (Maybe TrainingInputMode)
-> Parser
     (Maybe CompressionType
      -> Maybe Text -> Text -> DataSource -> Channel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TrainingInputMode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"InputMode")
            Parser
  (Maybe CompressionType
   -> Maybe Text -> Text -> DataSource -> Channel)
-> Parser (Maybe CompressionType)
-> Parser (Maybe Text -> Text -> DataSource -> Channel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe CompressionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"CompressionType")
            Parser (Maybe Text -> Text -> DataSource -> Channel)
-> Parser (Maybe Text) -> Parser (Text -> DataSource -> Channel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ContentType")
            Parser (Text -> DataSource -> Channel)
-> Parser Text -> Parser (DataSource -> Channel)
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
"ChannelName")
            Parser (DataSource -> Channel)
-> Parser DataSource -> Parser Channel
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser DataSource
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DataSource")
      )

instance Prelude.Hashable Channel

instance Prelude.NFData Channel

instance Core.ToJSON Channel where
  toJSON :: Channel -> Value
toJSON Channel' {Maybe Text
Maybe CompressionType
Maybe RecordWrapper
Maybe ShuffleConfig
Maybe TrainingInputMode
Text
DataSource
dataSource :: DataSource
channelName :: Text
contentType :: Maybe Text
compressionType :: Maybe CompressionType
inputMode :: Maybe TrainingInputMode
recordWrapperType :: Maybe RecordWrapper
shuffleConfig :: Maybe ShuffleConfig
$sel:dataSource:Channel' :: Channel -> DataSource
$sel:channelName:Channel' :: Channel -> Text
$sel:contentType:Channel' :: Channel -> Maybe Text
$sel:compressionType:Channel' :: Channel -> Maybe CompressionType
$sel:inputMode:Channel' :: Channel -> Maybe TrainingInputMode
$sel:recordWrapperType:Channel' :: Channel -> Maybe RecordWrapper
$sel:shuffleConfig:Channel' :: Channel -> Maybe ShuffleConfig
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"ShuffleConfig" Text -> ShuffleConfig -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (ShuffleConfig -> Pair) -> Maybe ShuffleConfig -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe ShuffleConfig
shuffleConfig,
            (Text
"RecordWrapperType" Text -> RecordWrapper -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (RecordWrapper -> Pair) -> Maybe RecordWrapper -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RecordWrapper
recordWrapperType,
            (Text
"InputMode" Text -> TrainingInputMode -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TrainingInputMode -> Pair)
-> Maybe TrainingInputMode -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TrainingInputMode
inputMode,
            (Text
"CompressionType" Text -> CompressionType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (CompressionType -> Pair) -> Maybe CompressionType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe CompressionType
compressionType,
            (Text
"ContentType" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
contentType,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ChannelName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
channelName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"DataSource" Text -> DataSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= DataSource
dataSource)
          ]
      )