{-# 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.Rekognition.Types.ValidationData
-- 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.Rekognition.Types.ValidationData where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.Asset

-- | Contains the Amazon S3 bucket location of the validation data for a
-- model training job.
--
-- The validation data includes error information for individual JSON lines
-- in the dataset. For more information, see Debugging a Failed Model
-- Training in the Amazon Rekognition Custom Labels Developer Guide.
--
-- You get the @ValidationData@ object for the training dataset
-- (TrainingDataResult) and the test dataset (TestingDataResult) by calling
-- DescribeProjectVersions.
--
-- The assets array contains a single Asset object. The GroundTruthManifest
-- field of the Asset object contains the S3 bucket location of the
-- validation data.
--
-- /See:/ 'newValidationData' smart constructor.
data ValidationData = ValidationData'
  { -- | The assets that comprise the validation data.
    ValidationData -> Maybe [Asset]
assets :: Prelude.Maybe [Asset]
  }
  deriving (ValidationData -> ValidationData -> Bool
(ValidationData -> ValidationData -> Bool)
-> (ValidationData -> ValidationData -> Bool) -> Eq ValidationData
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ValidationData -> ValidationData -> Bool
$c/= :: ValidationData -> ValidationData -> Bool
== :: ValidationData -> ValidationData -> Bool
$c== :: ValidationData -> ValidationData -> Bool
Prelude.Eq, ReadPrec [ValidationData]
ReadPrec ValidationData
Int -> ReadS ValidationData
ReadS [ValidationData]
(Int -> ReadS ValidationData)
-> ReadS [ValidationData]
-> ReadPrec ValidationData
-> ReadPrec [ValidationData]
-> Read ValidationData
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ValidationData]
$creadListPrec :: ReadPrec [ValidationData]
readPrec :: ReadPrec ValidationData
$creadPrec :: ReadPrec ValidationData
readList :: ReadS [ValidationData]
$creadList :: ReadS [ValidationData]
readsPrec :: Int -> ReadS ValidationData
$creadsPrec :: Int -> ReadS ValidationData
Prelude.Read, Int -> ValidationData -> ShowS
[ValidationData] -> ShowS
ValidationData -> String
(Int -> ValidationData -> ShowS)
-> (ValidationData -> String)
-> ([ValidationData] -> ShowS)
-> Show ValidationData
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ValidationData] -> ShowS
$cshowList :: [ValidationData] -> ShowS
show :: ValidationData -> String
$cshow :: ValidationData -> String
showsPrec :: Int -> ValidationData -> ShowS
$cshowsPrec :: Int -> ValidationData -> ShowS
Prelude.Show, (forall x. ValidationData -> Rep ValidationData x)
-> (forall x. Rep ValidationData x -> ValidationData)
-> Generic ValidationData
forall x. Rep ValidationData x -> ValidationData
forall x. ValidationData -> Rep ValidationData x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ValidationData x -> ValidationData
$cfrom :: forall x. ValidationData -> Rep ValidationData x
Prelude.Generic)

-- |
-- Create a value of 'ValidationData' 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:
--
-- 'assets', 'validationData_assets' - The assets that comprise the validation data.
newValidationData ::
  ValidationData
newValidationData :: ValidationData
newValidationData =
  ValidationData' :: Maybe [Asset] -> ValidationData
ValidationData' {$sel:assets:ValidationData' :: Maybe [Asset]
assets = Maybe [Asset]
forall a. Maybe a
Prelude.Nothing}

-- | The assets that comprise the validation data.
validationData_assets :: Lens.Lens' ValidationData (Prelude.Maybe [Asset])
validationData_assets :: (Maybe [Asset] -> f (Maybe [Asset]))
-> ValidationData -> f ValidationData
validationData_assets = (ValidationData -> Maybe [Asset])
-> (ValidationData -> Maybe [Asset] -> ValidationData)
-> Lens
     ValidationData ValidationData (Maybe [Asset]) (Maybe [Asset])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ValidationData' {Maybe [Asset]
assets :: Maybe [Asset]
$sel:assets:ValidationData' :: ValidationData -> Maybe [Asset]
assets} -> Maybe [Asset]
assets) (\s :: ValidationData
s@ValidationData' {} Maybe [Asset]
a -> ValidationData
s {$sel:assets:ValidationData' :: Maybe [Asset]
assets = Maybe [Asset]
a} :: ValidationData) ((Maybe [Asset] -> f (Maybe [Asset]))
 -> ValidationData -> f ValidationData)
-> ((Maybe [Asset] -> f (Maybe [Asset]))
    -> Maybe [Asset] -> f (Maybe [Asset]))
-> (Maybe [Asset] -> f (Maybe [Asset]))
-> ValidationData
-> f ValidationData
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Asset] [Asset] [Asset] [Asset]
-> Iso
     (Maybe [Asset]) (Maybe [Asset]) (Maybe [Asset]) (Maybe [Asset])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Asset] [Asset] [Asset] [Asset]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON ValidationData where
  parseJSON :: Value -> Parser ValidationData
parseJSON =
    String
-> (Object -> Parser ValidationData)
-> Value
-> Parser ValidationData
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ValidationData"
      ( \Object
x ->
          Maybe [Asset] -> ValidationData
ValidationData'
            (Maybe [Asset] -> ValidationData)
-> Parser (Maybe [Asset]) -> Parser ValidationData
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Asset]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Assets" Parser (Maybe (Maybe [Asset]))
-> Maybe [Asset] -> Parser (Maybe [Asset])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Asset]
forall a. Monoid a => a
Prelude.mempty)
      )

instance Prelude.Hashable ValidationData

instance Prelude.NFData ValidationData