{-# 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.LabelingJobSnsDataSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data LabelingJobSnsDataSource = LabelingJobSnsDataSource'
{
LabelingJobSnsDataSource -> Text
snsTopicArn :: Prelude.Text
}
deriving (LabelingJobSnsDataSource -> LabelingJobSnsDataSource -> Bool
(LabelingJobSnsDataSource -> LabelingJobSnsDataSource -> Bool)
-> (LabelingJobSnsDataSource -> LabelingJobSnsDataSource -> Bool)
-> Eq LabelingJobSnsDataSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: LabelingJobSnsDataSource -> LabelingJobSnsDataSource -> Bool
$c/= :: LabelingJobSnsDataSource -> LabelingJobSnsDataSource -> Bool
== :: LabelingJobSnsDataSource -> LabelingJobSnsDataSource -> Bool
$c== :: LabelingJobSnsDataSource -> LabelingJobSnsDataSource -> Bool
Prelude.Eq, ReadPrec [LabelingJobSnsDataSource]
ReadPrec LabelingJobSnsDataSource
Int -> ReadS LabelingJobSnsDataSource
ReadS [LabelingJobSnsDataSource]
(Int -> ReadS LabelingJobSnsDataSource)
-> ReadS [LabelingJobSnsDataSource]
-> ReadPrec LabelingJobSnsDataSource
-> ReadPrec [LabelingJobSnsDataSource]
-> Read LabelingJobSnsDataSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [LabelingJobSnsDataSource]
$creadListPrec :: ReadPrec [LabelingJobSnsDataSource]
readPrec :: ReadPrec LabelingJobSnsDataSource
$creadPrec :: ReadPrec LabelingJobSnsDataSource
readList :: ReadS [LabelingJobSnsDataSource]
$creadList :: ReadS [LabelingJobSnsDataSource]
readsPrec :: Int -> ReadS LabelingJobSnsDataSource
$creadsPrec :: Int -> ReadS LabelingJobSnsDataSource
Prelude.Read, Int -> LabelingJobSnsDataSource -> ShowS
[LabelingJobSnsDataSource] -> ShowS
LabelingJobSnsDataSource -> String
(Int -> LabelingJobSnsDataSource -> ShowS)
-> (LabelingJobSnsDataSource -> String)
-> ([LabelingJobSnsDataSource] -> ShowS)
-> Show LabelingJobSnsDataSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [LabelingJobSnsDataSource] -> ShowS
$cshowList :: [LabelingJobSnsDataSource] -> ShowS
show :: LabelingJobSnsDataSource -> String
$cshow :: LabelingJobSnsDataSource -> String
showsPrec :: Int -> LabelingJobSnsDataSource -> ShowS
$cshowsPrec :: Int -> LabelingJobSnsDataSource -> ShowS
Prelude.Show, (forall x.
LabelingJobSnsDataSource -> Rep LabelingJobSnsDataSource x)
-> (forall x.
Rep LabelingJobSnsDataSource x -> LabelingJobSnsDataSource)
-> Generic LabelingJobSnsDataSource
forall x.
Rep LabelingJobSnsDataSource x -> LabelingJobSnsDataSource
forall x.
LabelingJobSnsDataSource -> Rep LabelingJobSnsDataSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep LabelingJobSnsDataSource x -> LabelingJobSnsDataSource
$cfrom :: forall x.
LabelingJobSnsDataSource -> Rep LabelingJobSnsDataSource x
Prelude.Generic)
newLabelingJobSnsDataSource ::
Prelude.Text ->
LabelingJobSnsDataSource
newLabelingJobSnsDataSource :: Text -> LabelingJobSnsDataSource
newLabelingJobSnsDataSource Text
pSnsTopicArn_ =
LabelingJobSnsDataSource' :: Text -> LabelingJobSnsDataSource
LabelingJobSnsDataSource'
{ $sel:snsTopicArn:LabelingJobSnsDataSource' :: Text
snsTopicArn =
Text
pSnsTopicArn_
}
labelingJobSnsDataSource_snsTopicArn :: Lens.Lens' LabelingJobSnsDataSource Prelude.Text
labelingJobSnsDataSource_snsTopicArn :: (Text -> f Text)
-> LabelingJobSnsDataSource -> f LabelingJobSnsDataSource
labelingJobSnsDataSource_snsTopicArn = (LabelingJobSnsDataSource -> Text)
-> (LabelingJobSnsDataSource -> Text -> LabelingJobSnsDataSource)
-> Lens LabelingJobSnsDataSource LabelingJobSnsDataSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\LabelingJobSnsDataSource' {Text
snsTopicArn :: Text
$sel:snsTopicArn:LabelingJobSnsDataSource' :: LabelingJobSnsDataSource -> Text
snsTopicArn} -> Text
snsTopicArn) (\s :: LabelingJobSnsDataSource
s@LabelingJobSnsDataSource' {} Text
a -> LabelingJobSnsDataSource
s {$sel:snsTopicArn:LabelingJobSnsDataSource' :: Text
snsTopicArn = Text
a} :: LabelingJobSnsDataSource)
instance Core.FromJSON LabelingJobSnsDataSource where
parseJSON :: Value -> Parser LabelingJobSnsDataSource
parseJSON =
String
-> (Object -> Parser LabelingJobSnsDataSource)
-> Value
-> Parser LabelingJobSnsDataSource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"LabelingJobSnsDataSource"
( \Object
x ->
Text -> LabelingJobSnsDataSource
LabelingJobSnsDataSource'
(Text -> LabelingJobSnsDataSource)
-> Parser Text -> Parser LabelingJobSnsDataSource
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SnsTopicArn")
)
instance Prelude.Hashable LabelingJobSnsDataSource
instance Prelude.NFData LabelingJobSnsDataSource
instance Core.ToJSON LabelingJobSnsDataSource where
toJSON :: LabelingJobSnsDataSource -> Value
toJSON LabelingJobSnsDataSource' {Text
snsTopicArn :: Text
$sel:snsTopicArn:LabelingJobSnsDataSource' :: LabelingJobSnsDataSource -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"SnsTopicArn" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
snsTopicArn)]
)