{-# 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.LabelingJobOutputConfig where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data LabelingJobOutputConfig = LabelingJobOutputConfig'
{
LabelingJobOutputConfig -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
LabelingJobOutputConfig -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
LabelingJobOutputConfig -> Text
s3OutputPath :: Prelude.Text
}
deriving (LabelingJobOutputConfig -> LabelingJobOutputConfig -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LabelingJobOutputConfig -> LabelingJobOutputConfig -> Bool
$c/= :: LabelingJobOutputConfig -> LabelingJobOutputConfig -> Bool
== :: LabelingJobOutputConfig -> LabelingJobOutputConfig -> Bool
$c== :: LabelingJobOutputConfig -> LabelingJobOutputConfig -> Bool
Prelude.Eq, ReadPrec [LabelingJobOutputConfig]
ReadPrec LabelingJobOutputConfig
Int -> ReadS LabelingJobOutputConfig
ReadS [LabelingJobOutputConfig]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LabelingJobOutputConfig]
$creadListPrec :: ReadPrec [LabelingJobOutputConfig]
readPrec :: ReadPrec LabelingJobOutputConfig
$creadPrec :: ReadPrec LabelingJobOutputConfig
readList :: ReadS [LabelingJobOutputConfig]
$creadList :: ReadS [LabelingJobOutputConfig]
readsPrec :: Int -> ReadS LabelingJobOutputConfig
$creadsPrec :: Int -> ReadS LabelingJobOutputConfig
Prelude.Read, Int -> LabelingJobOutputConfig -> ShowS
[LabelingJobOutputConfig] -> ShowS
LabelingJobOutputConfig -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabelingJobOutputConfig] -> ShowS
$cshowList :: [LabelingJobOutputConfig] -> ShowS
show :: LabelingJobOutputConfig -> String
$cshow :: LabelingJobOutputConfig -> String
showsPrec :: Int -> LabelingJobOutputConfig -> ShowS
$cshowsPrec :: Int -> LabelingJobOutputConfig -> ShowS
Prelude.Show, forall x. Rep LabelingJobOutputConfig x -> LabelingJobOutputConfig
forall x. LabelingJobOutputConfig -> Rep LabelingJobOutputConfig x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep LabelingJobOutputConfig x -> LabelingJobOutputConfig
$cfrom :: forall x. LabelingJobOutputConfig -> Rep LabelingJobOutputConfig x
Prelude.Generic)
newLabelingJobOutputConfig ::
Prelude.Text ->
LabelingJobOutputConfig
newLabelingJobOutputConfig :: Text -> LabelingJobOutputConfig
newLabelingJobOutputConfig Text
pS3OutputPath_ =
LabelingJobOutputConfig'
{ $sel:kmsKeyId:LabelingJobOutputConfig' :: Maybe Text
kmsKeyId =
forall a. Maybe a
Prelude.Nothing,
$sel:snsTopicArn:LabelingJobOutputConfig' :: Maybe Text
snsTopicArn = forall a. Maybe a
Prelude.Nothing,
$sel:s3OutputPath:LabelingJobOutputConfig' :: Text
s3OutputPath = Text
pS3OutputPath_
}
labelingJobOutputConfig_kmsKeyId :: Lens.Lens' LabelingJobOutputConfig (Prelude.Maybe Prelude.Text)
labelingJobOutputConfig_kmsKeyId :: Lens' LabelingJobOutputConfig (Maybe Text)
labelingJobOutputConfig_kmsKeyId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelingJobOutputConfig' {Maybe Text
kmsKeyId :: Maybe Text
$sel:kmsKeyId:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Maybe Text
kmsKeyId} -> Maybe Text
kmsKeyId) (\s :: LabelingJobOutputConfig
s@LabelingJobOutputConfig' {} Maybe Text
a -> LabelingJobOutputConfig
s {$sel:kmsKeyId:LabelingJobOutputConfig' :: Maybe Text
kmsKeyId = Maybe Text
a} :: LabelingJobOutputConfig)
labelingJobOutputConfig_snsTopicArn :: Lens.Lens' LabelingJobOutputConfig (Prelude.Maybe Prelude.Text)
labelingJobOutputConfig_snsTopicArn :: Lens' LabelingJobOutputConfig (Maybe Text)
labelingJobOutputConfig_snsTopicArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelingJobOutputConfig' {Maybe Text
snsTopicArn :: Maybe Text
$sel:snsTopicArn:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Maybe Text
snsTopicArn} -> Maybe Text
snsTopicArn) (\s :: LabelingJobOutputConfig
s@LabelingJobOutputConfig' {} Maybe Text
a -> LabelingJobOutputConfig
s {$sel:snsTopicArn:LabelingJobOutputConfig' :: Maybe Text
snsTopicArn = Maybe Text
a} :: LabelingJobOutputConfig)
labelingJobOutputConfig_s3OutputPath :: Lens.Lens' LabelingJobOutputConfig Prelude.Text
labelingJobOutputConfig_s3OutputPath :: Lens' LabelingJobOutputConfig Text
labelingJobOutputConfig_s3OutputPath = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelingJobOutputConfig' {Text
s3OutputPath :: Text
$sel:s3OutputPath:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Text
s3OutputPath} -> Text
s3OutputPath) (\s :: LabelingJobOutputConfig
s@LabelingJobOutputConfig' {} Text
a -> LabelingJobOutputConfig
s {$sel:s3OutputPath:LabelingJobOutputConfig' :: Text
s3OutputPath = Text
a} :: LabelingJobOutputConfig)
instance Data.FromJSON LabelingJobOutputConfig where
parseJSON :: Value -> Parser LabelingJobOutputConfig
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"LabelingJobOutputConfig"
( \Object
x ->
Maybe Text -> Maybe Text -> Text -> LabelingJobOutputConfig
LabelingJobOutputConfig'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"KmsKeyId")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SnsTopicArn")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"S3OutputPath")
)
instance Prelude.Hashable LabelingJobOutputConfig where
hashWithSalt :: Int -> LabelingJobOutputConfig -> Int
hashWithSalt Int
_salt LabelingJobOutputConfig' {Maybe Text
Text
s3OutputPath :: Text
snsTopicArn :: Maybe Text
kmsKeyId :: Maybe Text
$sel:s3OutputPath:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Text
$sel:snsTopicArn:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Maybe Text
$sel:kmsKeyId:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
kmsKeyId
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snsTopicArn
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
s3OutputPath
instance Prelude.NFData LabelingJobOutputConfig where
rnf :: LabelingJobOutputConfig -> ()
rnf LabelingJobOutputConfig' {Maybe Text
Text
s3OutputPath :: Text
snsTopicArn :: Maybe Text
kmsKeyId :: Maybe Text
$sel:s3OutputPath:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Text
$sel:snsTopicArn:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Maybe Text
$sel:kmsKeyId:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
kmsKeyId
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snsTopicArn
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
s3OutputPath
instance Data.ToJSON LabelingJobOutputConfig where
toJSON :: LabelingJobOutputConfig -> Value
toJSON LabelingJobOutputConfig' {Maybe Text
Text
s3OutputPath :: Text
snsTopicArn :: Maybe Text
kmsKeyId :: Maybe Text
$sel:s3OutputPath:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Text
$sel:snsTopicArn:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Maybe Text
$sel:kmsKeyId:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"KmsKeyId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
kmsKeyId,
(Key
"SnsTopicArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
snsTopicArn,
forall a. a -> Maybe a
Prelude.Just (Key
"S3OutputPath" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
s3OutputPath)
]
)