{-# 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.TransformOutput where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.SageMaker.Types.AssemblyType
data TransformOutput = TransformOutput'
{
TransformOutput -> Maybe AssemblyType
assembleWith :: Prelude.Maybe AssemblyType,
TransformOutput -> Maybe Text
accept :: Prelude.Maybe Prelude.Text,
TransformOutput -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
TransformOutput -> Text
s3OutputPath :: Prelude.Text
}
deriving (TransformOutput -> TransformOutput -> Bool
(TransformOutput -> TransformOutput -> Bool)
-> (TransformOutput -> TransformOutput -> Bool)
-> Eq TransformOutput
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TransformOutput -> TransformOutput -> Bool
$c/= :: TransformOutput -> TransformOutput -> Bool
== :: TransformOutput -> TransformOutput -> Bool
$c== :: TransformOutput -> TransformOutput -> Bool
Prelude.Eq, ReadPrec [TransformOutput]
ReadPrec TransformOutput
Int -> ReadS TransformOutput
ReadS [TransformOutput]
(Int -> ReadS TransformOutput)
-> ReadS [TransformOutput]
-> ReadPrec TransformOutput
-> ReadPrec [TransformOutput]
-> Read TransformOutput
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TransformOutput]
$creadListPrec :: ReadPrec [TransformOutput]
readPrec :: ReadPrec TransformOutput
$creadPrec :: ReadPrec TransformOutput
readList :: ReadS [TransformOutput]
$creadList :: ReadS [TransformOutput]
readsPrec :: Int -> ReadS TransformOutput
$creadsPrec :: Int -> ReadS TransformOutput
Prelude.Read, Int -> TransformOutput -> ShowS
[TransformOutput] -> ShowS
TransformOutput -> String
(Int -> TransformOutput -> ShowS)
-> (TransformOutput -> String)
-> ([TransformOutput] -> ShowS)
-> Show TransformOutput
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TransformOutput] -> ShowS
$cshowList :: [TransformOutput] -> ShowS
show :: TransformOutput -> String
$cshow :: TransformOutput -> String
showsPrec :: Int -> TransformOutput -> ShowS
$cshowsPrec :: Int -> TransformOutput -> ShowS
Prelude.Show, (forall x. TransformOutput -> Rep TransformOutput x)
-> (forall x. Rep TransformOutput x -> TransformOutput)
-> Generic TransformOutput
forall x. Rep TransformOutput x -> TransformOutput
forall x. TransformOutput -> Rep TransformOutput x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TransformOutput x -> TransformOutput
$cfrom :: forall x. TransformOutput -> Rep TransformOutput x
Prelude.Generic)
newTransformOutput ::
Prelude.Text ->
TransformOutput
newTransformOutput :: Text -> TransformOutput
newTransformOutput Text
pS3OutputPath_ =
TransformOutput' :: Maybe AssemblyType
-> Maybe Text -> Maybe Text -> Text -> TransformOutput
TransformOutput'
{ $sel:assembleWith:TransformOutput' :: Maybe AssemblyType
assembleWith = Maybe AssemblyType
forall a. Maybe a
Prelude.Nothing,
$sel:accept:TransformOutput' :: Maybe Text
accept = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyId:TransformOutput' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3OutputPath:TransformOutput' :: Text
s3OutputPath = Text
pS3OutputPath_
}
transformOutput_assembleWith :: Lens.Lens' TransformOutput (Prelude.Maybe AssemblyType)
transformOutput_assembleWith :: (Maybe AssemblyType -> f (Maybe AssemblyType))
-> TransformOutput -> f TransformOutput
transformOutput_assembleWith = (TransformOutput -> Maybe AssemblyType)
-> (TransformOutput -> Maybe AssemblyType -> TransformOutput)
-> Lens
TransformOutput
TransformOutput
(Maybe AssemblyType)
(Maybe AssemblyType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformOutput' {Maybe AssemblyType
assembleWith :: Maybe AssemblyType
$sel:assembleWith:TransformOutput' :: TransformOutput -> Maybe AssemblyType
assembleWith} -> Maybe AssemblyType
assembleWith) (\s :: TransformOutput
s@TransformOutput' {} Maybe AssemblyType
a -> TransformOutput
s {$sel:assembleWith:TransformOutput' :: Maybe AssemblyType
assembleWith = Maybe AssemblyType
a} :: TransformOutput)
transformOutput_accept :: Lens.Lens' TransformOutput (Prelude.Maybe Prelude.Text)
transformOutput_accept :: (Maybe Text -> f (Maybe Text))
-> TransformOutput -> f TransformOutput
transformOutput_accept = (TransformOutput -> Maybe Text)
-> (TransformOutput -> Maybe Text -> TransformOutput)
-> Lens TransformOutput TransformOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformOutput' {Maybe Text
accept :: Maybe Text
$sel:accept:TransformOutput' :: TransformOutput -> Maybe Text
accept} -> Maybe Text
accept) (\s :: TransformOutput
s@TransformOutput' {} Maybe Text
a -> TransformOutput
s {$sel:accept:TransformOutput' :: Maybe Text
accept = Maybe Text
a} :: TransformOutput)
transformOutput_kmsKeyId :: Lens.Lens' TransformOutput (Prelude.Maybe Prelude.Text)
transformOutput_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> TransformOutput -> f TransformOutput
transformOutput_kmsKeyId = (TransformOutput -> Maybe Text)
-> (TransformOutput -> Maybe Text -> TransformOutput)
-> Lens TransformOutput TransformOutput (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformOutput' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:TransformOutput' :: TransformOutput -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: TransformOutput
s@TransformOutput' {} Maybe Text
a -> TransformOutput
s {$sel:kmsKeyId:TransformOutput' :: Maybe Text
kmsKeyId = Maybe Text
a} :: TransformOutput)
transformOutput_s3OutputPath :: Lens.Lens' TransformOutput Prelude.Text
transformOutput_s3OutputPath :: (Text -> f Text) -> TransformOutput -> f TransformOutput
transformOutput_s3OutputPath = (TransformOutput -> Text)
-> (TransformOutput -> Text -> TransformOutput)
-> Lens TransformOutput TransformOutput Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TransformOutput' {Text
s3OutputPath :: Text
$sel:s3OutputPath:TransformOutput' :: TransformOutput -> Text
s3OutputPath} -> Text
s3OutputPath) (\s :: TransformOutput
s@TransformOutput' {} Text
a -> TransformOutput
s {$sel:s3OutputPath:TransformOutput' :: Text
s3OutputPath = Text
a} :: TransformOutput)
instance Core.FromJSON TransformOutput where
parseJSON :: Value -> Parser TransformOutput
parseJSON =
String
-> (Object -> Parser TransformOutput)
-> Value
-> Parser TransformOutput
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"TransformOutput"
( \Object
x ->
Maybe AssemblyType
-> Maybe Text -> Maybe Text -> Text -> TransformOutput
TransformOutput'
(Maybe AssemblyType
-> Maybe Text -> Maybe Text -> Text -> TransformOutput)
-> Parser (Maybe AssemblyType)
-> Parser (Maybe Text -> Maybe Text -> Text -> TransformOutput)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe AssemblyType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"AssembleWith")
Parser (Maybe Text -> Maybe Text -> Text -> TransformOutput)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Text -> TransformOutput)
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
"Accept")
Parser (Maybe Text -> Text -> TransformOutput)
-> Parser (Maybe Text) -> Parser (Text -> TransformOutput)
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
"KmsKeyId")
Parser (Text -> TransformOutput)
-> Parser Text -> Parser TransformOutput
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
"S3OutputPath")
)
instance Prelude.Hashable TransformOutput
instance Prelude.NFData TransformOutput
instance Core.ToJSON TransformOutput where
toJSON :: TransformOutput -> Value
toJSON TransformOutput' {Maybe Text
Maybe AssemblyType
Text
s3OutputPath :: Text
kmsKeyId :: Maybe Text
accept :: Maybe Text
assembleWith :: Maybe AssemblyType
$sel:s3OutputPath:TransformOutput' :: TransformOutput -> Text
$sel:kmsKeyId:TransformOutput' :: TransformOutput -> Maybe Text
$sel:accept:TransformOutput' :: TransformOutput -> Maybe Text
$sel:assembleWith:TransformOutput' :: TransformOutput -> Maybe AssemblyType
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"AssembleWith" Text -> AssemblyType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (AssemblyType -> Pair) -> Maybe AssemblyType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe AssemblyType
assembleWith,
(Text
"Accept" 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
accept,
(Text
"KmsKeyId" 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
kmsKeyId,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"S3OutputPath" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
s3OutputPath)
]
)