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