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

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

-- | The S3 bucket that contains the training summary. The training summary
-- includes aggregated evaluation metrics for the entire testing dataset
-- and metrics for each individual label.
--
-- You get the training summary S3 bucket location by calling
-- DescribeProjectVersions.
--
-- /See:/ 'newSummary' smart constructor.
data Summary = Summary'
  { Summary -> Maybe S3Object
s3Object :: Prelude.Maybe S3Object
  }
  deriving (Summary -> Summary -> Bool
(Summary -> Summary -> Bool)
-> (Summary -> Summary -> Bool) -> Eq Summary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Summary -> Summary -> Bool
$c/= :: Summary -> Summary -> Bool
== :: Summary -> Summary -> Bool
$c== :: Summary -> Summary -> Bool
Prelude.Eq, ReadPrec [Summary]
ReadPrec Summary
Int -> ReadS Summary
ReadS [Summary]
(Int -> ReadS Summary)
-> ReadS [Summary]
-> ReadPrec Summary
-> ReadPrec [Summary]
-> Read Summary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Summary]
$creadListPrec :: ReadPrec [Summary]
readPrec :: ReadPrec Summary
$creadPrec :: ReadPrec Summary
readList :: ReadS [Summary]
$creadList :: ReadS [Summary]
readsPrec :: Int -> ReadS Summary
$creadsPrec :: Int -> ReadS Summary
Prelude.Read, Int -> Summary -> ShowS
[Summary] -> ShowS
Summary -> String
(Int -> Summary -> ShowS)
-> (Summary -> String) -> ([Summary] -> ShowS) -> Show Summary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Summary] -> ShowS
$cshowList :: [Summary] -> ShowS
show :: Summary -> String
$cshow :: Summary -> String
showsPrec :: Int -> Summary -> ShowS
$cshowsPrec :: Int -> Summary -> ShowS
Prelude.Show, (forall x. Summary -> Rep Summary x)
-> (forall x. Rep Summary x -> Summary) -> Generic Summary
forall x. Rep Summary x -> Summary
forall x. Summary -> Rep Summary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Summary x -> Summary
$cfrom :: forall x. Summary -> Rep Summary x
Prelude.Generic)

-- |
-- Create a value of 'Summary' 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:
--
-- 's3Object', 'summary_s3Object' - Undocumented member.
newSummary ::
  Summary
newSummary :: Summary
newSummary = Summary' :: Maybe S3Object -> Summary
Summary' {$sel:s3Object:Summary' :: Maybe S3Object
s3Object = Maybe S3Object
forall a. Maybe a
Prelude.Nothing}

-- | Undocumented member.
summary_s3Object :: Lens.Lens' Summary (Prelude.Maybe S3Object)
summary_s3Object :: (Maybe S3Object -> f (Maybe S3Object)) -> Summary -> f Summary
summary_s3Object = (Summary -> Maybe S3Object)
-> (Summary -> Maybe S3Object -> Summary)
-> Lens Summary Summary (Maybe S3Object) (Maybe S3Object)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Summary' {Maybe S3Object
s3Object :: Maybe S3Object
$sel:s3Object:Summary' :: Summary -> Maybe S3Object
s3Object} -> Maybe S3Object
s3Object) (\s :: Summary
s@Summary' {} Maybe S3Object
a -> Summary
s {$sel:s3Object:Summary' :: Maybe S3Object
s3Object = Maybe S3Object
a} :: Summary)

instance Core.FromJSON Summary where
  parseJSON :: Value -> Parser Summary
parseJSON =
    String -> (Object -> Parser Summary) -> Value -> Parser Summary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"Summary"
      (\Object
x -> Maybe S3Object -> Summary
Summary' (Maybe S3Object -> Summary)
-> Parser (Maybe S3Object) -> Parser Summary
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe S3Object)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"S3Object"))

instance Prelude.Hashable Summary

instance Prelude.NFData Summary