{-# 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.TestingDataResult
-- 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.TestingDataResult where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Rekognition.Types.TestingData
import Amazonka.Rekognition.Types.ValidationData

-- | Sagemaker Groundtruth format manifest files for the input, output and
-- validation datasets that are used and created during testing.
--
-- /See:/ 'newTestingDataResult' smart constructor.
data TestingDataResult = TestingDataResult'
  { -- | The testing dataset that was supplied for training.
    TestingDataResult -> Maybe TestingData
input :: Prelude.Maybe TestingData,
    -- | The subset of the dataset that was actually tested. Some images (assets)
    -- might not be tested due to file formatting and other issues.
    TestingDataResult -> Maybe TestingData
output :: Prelude.Maybe TestingData,
    -- | The location of the data validation manifest. The data validation
    -- manifest is created for the test dataset during model training.
    TestingDataResult -> Maybe ValidationData
validation :: Prelude.Maybe ValidationData
  }
  deriving (TestingDataResult -> TestingDataResult -> Bool
(TestingDataResult -> TestingDataResult -> Bool)
-> (TestingDataResult -> TestingDataResult -> Bool)
-> Eq TestingDataResult
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: TestingDataResult -> TestingDataResult -> Bool
$c/= :: TestingDataResult -> TestingDataResult -> Bool
== :: TestingDataResult -> TestingDataResult -> Bool
$c== :: TestingDataResult -> TestingDataResult -> Bool
Prelude.Eq, ReadPrec [TestingDataResult]
ReadPrec TestingDataResult
Int -> ReadS TestingDataResult
ReadS [TestingDataResult]
(Int -> ReadS TestingDataResult)
-> ReadS [TestingDataResult]
-> ReadPrec TestingDataResult
-> ReadPrec [TestingDataResult]
-> Read TestingDataResult
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [TestingDataResult]
$creadListPrec :: ReadPrec [TestingDataResult]
readPrec :: ReadPrec TestingDataResult
$creadPrec :: ReadPrec TestingDataResult
readList :: ReadS [TestingDataResult]
$creadList :: ReadS [TestingDataResult]
readsPrec :: Int -> ReadS TestingDataResult
$creadsPrec :: Int -> ReadS TestingDataResult
Prelude.Read, Int -> TestingDataResult -> ShowS
[TestingDataResult] -> ShowS
TestingDataResult -> String
(Int -> TestingDataResult -> ShowS)
-> (TestingDataResult -> String)
-> ([TestingDataResult] -> ShowS)
-> Show TestingDataResult
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [TestingDataResult] -> ShowS
$cshowList :: [TestingDataResult] -> ShowS
show :: TestingDataResult -> String
$cshow :: TestingDataResult -> String
showsPrec :: Int -> TestingDataResult -> ShowS
$cshowsPrec :: Int -> TestingDataResult -> ShowS
Prelude.Show, (forall x. TestingDataResult -> Rep TestingDataResult x)
-> (forall x. Rep TestingDataResult x -> TestingDataResult)
-> Generic TestingDataResult
forall x. Rep TestingDataResult x -> TestingDataResult
forall x. TestingDataResult -> Rep TestingDataResult x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep TestingDataResult x -> TestingDataResult
$cfrom :: forall x. TestingDataResult -> Rep TestingDataResult x
Prelude.Generic)

-- |
-- Create a value of 'TestingDataResult' 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:
--
-- 'input', 'testingDataResult_input' - The testing dataset that was supplied for training.
--
-- 'output', 'testingDataResult_output' - The subset of the dataset that was actually tested. Some images (assets)
-- might not be tested due to file formatting and other issues.
--
-- 'validation', 'testingDataResult_validation' - The location of the data validation manifest. The data validation
-- manifest is created for the test dataset during model training.
newTestingDataResult ::
  TestingDataResult
newTestingDataResult :: TestingDataResult
newTestingDataResult =
  TestingDataResult' :: Maybe TestingData
-> Maybe TestingData -> Maybe ValidationData -> TestingDataResult
TestingDataResult'
    { $sel:input:TestingDataResult' :: Maybe TestingData
input = Maybe TestingData
forall a. Maybe a
Prelude.Nothing,
      $sel:output:TestingDataResult' :: Maybe TestingData
output = Maybe TestingData
forall a. Maybe a
Prelude.Nothing,
      $sel:validation:TestingDataResult' :: Maybe ValidationData
validation = Maybe ValidationData
forall a. Maybe a
Prelude.Nothing
    }

-- | The testing dataset that was supplied for training.
testingDataResult_input :: Lens.Lens' TestingDataResult (Prelude.Maybe TestingData)
testingDataResult_input :: (Maybe TestingData -> f (Maybe TestingData))
-> TestingDataResult -> f TestingDataResult
testingDataResult_input = (TestingDataResult -> Maybe TestingData)
-> (TestingDataResult -> Maybe TestingData -> TestingDataResult)
-> Lens
     TestingDataResult
     TestingDataResult
     (Maybe TestingData)
     (Maybe TestingData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestingDataResult' {Maybe TestingData
input :: Maybe TestingData
$sel:input:TestingDataResult' :: TestingDataResult -> Maybe TestingData
input} -> Maybe TestingData
input) (\s :: TestingDataResult
s@TestingDataResult' {} Maybe TestingData
a -> TestingDataResult
s {$sel:input:TestingDataResult' :: Maybe TestingData
input = Maybe TestingData
a} :: TestingDataResult)

-- | The subset of the dataset that was actually tested. Some images (assets)
-- might not be tested due to file formatting and other issues.
testingDataResult_output :: Lens.Lens' TestingDataResult (Prelude.Maybe TestingData)
testingDataResult_output :: (Maybe TestingData -> f (Maybe TestingData))
-> TestingDataResult -> f TestingDataResult
testingDataResult_output = (TestingDataResult -> Maybe TestingData)
-> (TestingDataResult -> Maybe TestingData -> TestingDataResult)
-> Lens
     TestingDataResult
     TestingDataResult
     (Maybe TestingData)
     (Maybe TestingData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestingDataResult' {Maybe TestingData
output :: Maybe TestingData
$sel:output:TestingDataResult' :: TestingDataResult -> Maybe TestingData
output} -> Maybe TestingData
output) (\s :: TestingDataResult
s@TestingDataResult' {} Maybe TestingData
a -> TestingDataResult
s {$sel:output:TestingDataResult' :: Maybe TestingData
output = Maybe TestingData
a} :: TestingDataResult)

-- | The location of the data validation manifest. The data validation
-- manifest is created for the test dataset during model training.
testingDataResult_validation :: Lens.Lens' TestingDataResult (Prelude.Maybe ValidationData)
testingDataResult_validation :: (Maybe ValidationData -> f (Maybe ValidationData))
-> TestingDataResult -> f TestingDataResult
testingDataResult_validation = (TestingDataResult -> Maybe ValidationData)
-> (TestingDataResult -> Maybe ValidationData -> TestingDataResult)
-> Lens
     TestingDataResult
     TestingDataResult
     (Maybe ValidationData)
     (Maybe ValidationData)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\TestingDataResult' {Maybe ValidationData
validation :: Maybe ValidationData
$sel:validation:TestingDataResult' :: TestingDataResult -> Maybe ValidationData
validation} -> Maybe ValidationData
validation) (\s :: TestingDataResult
s@TestingDataResult' {} Maybe ValidationData
a -> TestingDataResult
s {$sel:validation:TestingDataResult' :: Maybe ValidationData
validation = Maybe ValidationData
a} :: TestingDataResult)

instance Core.FromJSON TestingDataResult where
  parseJSON :: Value -> Parser TestingDataResult
parseJSON =
    String
-> (Object -> Parser TestingDataResult)
-> Value
-> Parser TestingDataResult
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"TestingDataResult"
      ( \Object
x ->
          Maybe TestingData
-> Maybe TestingData -> Maybe ValidationData -> TestingDataResult
TestingDataResult'
            (Maybe TestingData
 -> Maybe TestingData -> Maybe ValidationData -> TestingDataResult)
-> Parser (Maybe TestingData)
-> Parser
     (Maybe TestingData -> Maybe ValidationData -> TestingDataResult)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TestingData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Input")
            Parser
  (Maybe TestingData -> Maybe ValidationData -> TestingDataResult)
-> Parser (Maybe TestingData)
-> Parser (Maybe ValidationData -> TestingDataResult)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe TestingData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Output")
            Parser (Maybe ValidationData -> TestingDataResult)
-> Parser (Maybe ValidationData) -> Parser TestingDataResult
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ValidationData)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Validation")
      )

instance Prelude.Hashable TestingDataResult

instance Prelude.NFData TestingDataResult