{-# 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 #-}
module Amazonka.SageMaker.Types.TransformInput 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.SplitType
import Amazonka.SageMaker.Types.TransformDataSource
data TransformInput = TransformInput'
{
TransformInput -> Maybe SplitType
splitType :: Prelude.Maybe SplitType,
TransformInput -> Maybe CompressionType
compressionType :: Prelude.Maybe CompressionType,
TransformInput -> Maybe Text
contentType :: Prelude.Maybe Prelude.Text,
TransformInput -> TransformDataSource
dataSource :: TransformDataSource
}
deriving (TransformInput -> TransformInput -> Bool
(TransformInput -> TransformInput -> Bool)
-> (TransformInput -> TransformInput -> Bool) -> Eq TransformInput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransformInput -> TransformInput -> Bool
$c/= :: TransformInput -> TransformInput -> Bool
== :: TransformInput -> TransformInput -> Bool
$c== :: TransformInput -> TransformInput -> Bool
Prelude.Eq, ReadPrec [TransformInput]
ReadPrec TransformInput
Int -> ReadS TransformInput
ReadS [TransformInput]
(Int -> ReadS TransformInput)
-> ReadS [TransformInput]
-> ReadPrec TransformInput
-> ReadPrec [TransformInput]
-> Read TransformInput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransformInput]
$creadListPrec :: ReadPrec [TransformInput]
readPrec :: ReadPrec TransformInput
$creadPrec :: ReadPrec TransformInput
readList :: ReadS [TransformInput]
$creadList :: ReadS [TransformInput]
readsPrec :: Int -> ReadS TransformInput
$creadsPrec :: Int -> ReadS TransformInput
Prelude.Read, Int -> TransformInput -> ShowS
[TransformInput] -> ShowS
TransformInput -> String
(Int -> TransformInput -> ShowS)
-> (TransformInput -> String)
-> ([TransformInput] -> ShowS)
-> Show TransformInput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransformInput] -> ShowS
$cshowList :: [TransformInput] -> ShowS
show :: TransformInput -> String
$cshow :: TransformInput -> String
showsPrec :: Int -> TransformInput -> ShowS
$cshowsPrec :: Int -> TransformInput -> ShowS
Prelude.Show, (forall x. TransformInput -> Rep TransformInput x)
-> (forall x. Rep TransformInput x -> TransformInput)
-> Generic TransformInput
forall x. Rep TransformInput x -> TransformInput
forall x. TransformInput -> Rep TransformInput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TransformInput x -> TransformInput
$cfrom :: forall x. TransformInput -> Rep TransformInput x
Prelude.Generic)
newTransformInput ::
TransformDataSource ->
TransformInput
newTransformInput :: TransformDataSource -> TransformInput
newTransformInput TransformDataSource
pDataSource_ =
TransformInput' :: Maybe SplitType
-> Maybe CompressionType
-> Maybe Text
-> TransformDataSource
-> TransformInput
TransformInput'
{ $sel:splitType:TransformInput' :: Maybe SplitType
splitType = Maybe SplitType
forall a. Maybe a
Prelude.Nothing,
$sel:compressionType:TransformInput' :: Maybe CompressionType
compressionType = Maybe CompressionType
forall a. Maybe a
Prelude.Nothing,
$sel:contentType:TransformInput' :: Maybe Text
contentType = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:dataSource:TransformInput' :: TransformDataSource
dataSource = TransformDataSource
pDataSource_
}
transformInput_splitType :: Lens.Lens' TransformInput (Prelude.Maybe SplitType)
transformInput_splitType :: (Maybe SplitType -> f (Maybe SplitType))
-> TransformInput -> f TransformInput
transformInput_splitType = (TransformInput -> Maybe SplitType)
-> (TransformInput -> Maybe SplitType -> TransformInput)
-> Lens
TransformInput TransformInput (Maybe SplitType) (Maybe SplitType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformInput' {Maybe SplitType
splitType :: Maybe SplitType
$sel:splitType:TransformInput' :: TransformInput -> Maybe SplitType
splitType} -> Maybe SplitType
splitType) (\s :: TransformInput
s@TransformInput' {} Maybe SplitType
a -> TransformInput
s {$sel:splitType:TransformInput' :: Maybe SplitType
splitType = Maybe SplitType
a} :: TransformInput)
transformInput_compressionType :: Lens.Lens' TransformInput (Prelude.Maybe CompressionType)
transformInput_compressionType :: (Maybe CompressionType -> f (Maybe CompressionType))
-> TransformInput -> f TransformInput
transformInput_compressionType = (TransformInput -> Maybe CompressionType)
-> (TransformInput -> Maybe CompressionType -> TransformInput)
-> Lens
TransformInput
TransformInput
(Maybe CompressionType)
(Maybe CompressionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformInput' {Maybe CompressionType
compressionType :: Maybe CompressionType
$sel:compressionType:TransformInput' :: TransformInput -> Maybe CompressionType
compressionType} -> Maybe CompressionType
compressionType) (\s :: TransformInput
s@TransformInput' {} Maybe CompressionType
a -> TransformInput
s {$sel:compressionType:TransformInput' :: Maybe CompressionType
compressionType = Maybe CompressionType
a} :: TransformInput)
transformInput_contentType :: Lens.Lens' TransformInput (Prelude.Maybe Prelude.Text)
transformInput_contentType :: (Maybe Text -> f (Maybe Text))
-> TransformInput -> f TransformInput
transformInput_contentType = (TransformInput -> Maybe Text)
-> (TransformInput -> Maybe Text -> TransformInput)
-> Lens TransformInput TransformInput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformInput' {Maybe Text
contentType :: Maybe Text
$sel:contentType:TransformInput' :: TransformInput -> Maybe Text
contentType} -> Maybe Text
contentType) (\s :: TransformInput
s@TransformInput' {} Maybe Text
a -> TransformInput
s {$sel:contentType:TransformInput' :: Maybe Text
contentType = Maybe Text
a} :: TransformInput)
transformInput_dataSource :: Lens.Lens' TransformInput TransformDataSource
transformInput_dataSource :: (TransformDataSource -> f TransformDataSource)
-> TransformInput -> f TransformInput
transformInput_dataSource = (TransformInput -> TransformDataSource)
-> (TransformInput -> TransformDataSource -> TransformInput)
-> Lens
TransformInput
TransformInput
TransformDataSource
TransformDataSource
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformInput' {TransformDataSource
dataSource :: TransformDataSource
$sel:dataSource:TransformInput' :: TransformInput -> TransformDataSource
dataSource} -> TransformDataSource
dataSource) (\s :: TransformInput
s@TransformInput' {} TransformDataSource
a -> TransformInput
s {$sel:dataSource:TransformInput' :: TransformDataSource
dataSource = TransformDataSource
a} :: TransformInput)
instance Core.FromJSON TransformInput where
parseJSON :: Value -> Parser TransformInput
parseJSON =
String
-> (Object -> Parser TransformInput)
-> Value
-> Parser TransformInput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TransformInput"
( \Object
x ->
Maybe SplitType
-> Maybe CompressionType
-> Maybe Text
-> TransformDataSource
-> TransformInput
TransformInput'
(Maybe SplitType
-> Maybe CompressionType
-> Maybe Text
-> TransformDataSource
-> TransformInput)
-> Parser (Maybe SplitType)
-> Parser
(Maybe CompressionType
-> Maybe Text -> TransformDataSource -> TransformInput)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe SplitType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SplitType")
Parser
(Maybe CompressionType
-> Maybe Text -> TransformDataSource -> TransformInput)
-> Parser (Maybe CompressionType)
-> Parser (Maybe Text -> TransformDataSource -> TransformInput)
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 -> TransformDataSource -> TransformInput)
-> Parser (Maybe Text)
-> Parser (TransformDataSource -> TransformInput)
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 (TransformDataSource -> TransformInput)
-> Parser TransformDataSource -> Parser TransformInput
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser TransformDataSource
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"DataSource")
)
instance Prelude.Hashable TransformInput
instance Prelude.NFData TransformInput
instance Core.ToJSON TransformInput where
toJSON :: TransformInput -> Value
toJSON TransformInput' {Maybe Text
Maybe CompressionType
Maybe SplitType
TransformDataSource
dataSource :: TransformDataSource
contentType :: Maybe Text
compressionType :: Maybe CompressionType
splitType :: Maybe SplitType
$sel:dataSource:TransformInput' :: TransformInput -> TransformDataSource
$sel:contentType:TransformInput' :: TransformInput -> Maybe Text
$sel:compressionType:TransformInput' :: TransformInput -> Maybe CompressionType
$sel:splitType:TransformInput' :: TransformInput -> Maybe SplitType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SplitType" Text -> SplitType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (SplitType -> Pair) -> Maybe SplitType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe SplitType
splitType,
(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
"DataSource" Text -> TransformDataSource -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= TransformDataSource
dataSource)
]
)