{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LabelingJobOutputConfig = LabelingJobOutputConfig'
{
LabelingJobOutputConfig -> Maybe Text
snsTopicArn :: Prelude.Maybe Prelude.Text,
LabelingJobOutputConfig -> Maybe Text
kmsKeyId :: Prelude.Maybe Prelude.Text,
LabelingJobOutputConfig -> Text
s3OutputPath :: Prelude.Text
}
deriving (LabelingJobOutputConfig -> LabelingJobOutputConfig -> Bool
(LabelingJobOutputConfig -> LabelingJobOutputConfig -> Bool)
-> (LabelingJobOutputConfig -> LabelingJobOutputConfig -> Bool)
-> Eq LabelingJobOutputConfig
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]
(Int -> ReadS LabelingJobOutputConfig)
-> ReadS [LabelingJobOutputConfig]
-> ReadPrec LabelingJobOutputConfig
-> ReadPrec [LabelingJobOutputConfig]
-> Read 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
(Int -> LabelingJobOutputConfig -> ShowS)
-> (LabelingJobOutputConfig -> String)
-> ([LabelingJobOutputConfig] -> ShowS)
-> Show LabelingJobOutputConfig
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.
LabelingJobOutputConfig -> Rep LabelingJobOutputConfig x)
-> (forall x.
Rep LabelingJobOutputConfig x -> LabelingJobOutputConfig)
-> Generic LabelingJobOutputConfig
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' :: Maybe Text -> Maybe Text -> Text -> LabelingJobOutputConfig
LabelingJobOutputConfig'
{ $sel:snsTopicArn:LabelingJobOutputConfig' :: Maybe Text
snsTopicArn =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:kmsKeyId:LabelingJobOutputConfig' :: Maybe Text
kmsKeyId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:s3OutputPath:LabelingJobOutputConfig' :: Text
s3OutputPath = Text
pS3OutputPath_
}
labelingJobOutputConfig_snsTopicArn :: Lens.Lens' LabelingJobOutputConfig (Prelude.Maybe Prelude.Text)
labelingJobOutputConfig_snsTopicArn :: (Maybe Text -> f (Maybe Text))
-> LabelingJobOutputConfig -> f LabelingJobOutputConfig
labelingJobOutputConfig_snsTopicArn = (LabelingJobOutputConfig -> Maybe Text)
-> (LabelingJobOutputConfig
-> Maybe Text -> LabelingJobOutputConfig)
-> Lens
LabelingJobOutputConfig
LabelingJobOutputConfig
(Maybe Text)
(Maybe Text)
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_kmsKeyId :: Lens.Lens' LabelingJobOutputConfig (Prelude.Maybe Prelude.Text)
labelingJobOutputConfig_kmsKeyId :: (Maybe Text -> f (Maybe Text))
-> LabelingJobOutputConfig -> f LabelingJobOutputConfig
labelingJobOutputConfig_kmsKeyId = (LabelingJobOutputConfig -> Maybe Text)
-> (LabelingJobOutputConfig
-> Maybe Text -> LabelingJobOutputConfig)
-> Lens
LabelingJobOutputConfig
LabelingJobOutputConfig
(Maybe Text)
(Maybe Text)
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_s3OutputPath :: Lens.Lens' LabelingJobOutputConfig Prelude.Text
labelingJobOutputConfig_s3OutputPath :: (Text -> f Text)
-> LabelingJobOutputConfig -> f LabelingJobOutputConfig
labelingJobOutputConfig_s3OutputPath = (LabelingJobOutputConfig -> Text)
-> (LabelingJobOutputConfig -> Text -> LabelingJobOutputConfig)
-> Lens LabelingJobOutputConfig LabelingJobOutputConfig Text Text
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 Core.FromJSON LabelingJobOutputConfig where
parseJSON :: Value -> Parser LabelingJobOutputConfig
parseJSON =
String
-> (Object -> Parser LabelingJobOutputConfig)
-> Value
-> Parser LabelingJobOutputConfig
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LabelingJobOutputConfig"
( \Object
x ->
Maybe Text -> Maybe Text -> Text -> LabelingJobOutputConfig
LabelingJobOutputConfig'
(Maybe Text -> Maybe Text -> Text -> LabelingJobOutputConfig)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Text -> LabelingJobOutputConfig)
forall (f :: * -> *) a b. Functor 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
"SnsTopicArn")
Parser (Maybe Text -> Text -> LabelingJobOutputConfig)
-> Parser (Maybe Text) -> Parser (Text -> LabelingJobOutputConfig)
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 -> LabelingJobOutputConfig)
-> Parser Text -> Parser LabelingJobOutputConfig
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 LabelingJobOutputConfig
instance Prelude.NFData LabelingJobOutputConfig
instance Core.ToJSON LabelingJobOutputConfig where
toJSON :: LabelingJobOutputConfig -> Value
toJSON LabelingJobOutputConfig' {Maybe Text
Text
s3OutputPath :: Text
kmsKeyId :: Maybe Text
snsTopicArn :: Maybe Text
$sel:s3OutputPath:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Text
$sel:kmsKeyId:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Maybe Text
$sel:snsTopicArn:LabelingJobOutputConfig' :: LabelingJobOutputConfig -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"SnsTopicArn" 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
snsTopicArn,
(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)
]
)