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