{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.LookoutVision.Types.DatasetSource
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Information about the location of a manifest file that Amazon Lookout
-- for Vision uses to to create a dataset.
--
-- /See:/ 'newDatasetSource' smart constructor.
data DatasetSource = DatasetSource'
  { -- | Location information for the manifest file.
    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)

-- |
-- Create a value of 'DatasetSource' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'groundTruthManifest', 'datasetSource_groundTruthManifest' - Location information for the manifest file.
newDatasetSource ::
  DatasetSource
newDatasetSource :: DatasetSource
newDatasetSource =
  DatasetSource' :: Maybe DatasetGroundTruthManifest -> DatasetSource
DatasetSource'
    { $sel:groundTruthManifest:DatasetSource' :: Maybe DatasetGroundTruthManifest
groundTruthManifest =
        Maybe DatasetGroundTruthManifest
forall a. Maybe a
Prelude.Nothing
    }

-- | Location information for the manifest file.
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
          ]
      )