{-# 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.MacieV2.Types.Statistics
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MacieV2.Types.Statistics where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Provides processing statistics for a classification job.
--
-- /See:/ 'newStatistics' smart constructor.
data Statistics = Statistics'
  { -- | The approximate number of objects that the job has yet to process during
    -- its current run.
    Statistics -> Maybe Double
approximateNumberOfObjectsToProcess :: Prelude.Maybe Prelude.Double,
    -- | The number of times that the job has run.
    Statistics -> Maybe Double
numberOfRuns :: Prelude.Maybe Prelude.Double
  }
  deriving (Statistics -> Statistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Statistics -> Statistics -> Bool
$c/= :: Statistics -> Statistics -> Bool
== :: Statistics -> Statistics -> Bool
$c== :: Statistics -> Statistics -> Bool
Prelude.Eq, ReadPrec [Statistics]
ReadPrec Statistics
Int -> ReadS Statistics
ReadS [Statistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Statistics]
$creadListPrec :: ReadPrec [Statistics]
readPrec :: ReadPrec Statistics
$creadPrec :: ReadPrec Statistics
readList :: ReadS [Statistics]
$creadList :: ReadS [Statistics]
readsPrec :: Int -> ReadS Statistics
$creadsPrec :: Int -> ReadS Statistics
Prelude.Read, Int -> Statistics -> ShowS
[Statistics] -> ShowS
Statistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Statistics] -> ShowS
$cshowList :: [Statistics] -> ShowS
show :: Statistics -> String
$cshow :: Statistics -> String
showsPrec :: Int -> Statistics -> ShowS
$cshowsPrec :: Int -> Statistics -> ShowS
Prelude.Show, forall x. Rep Statistics x -> Statistics
forall x. Statistics -> Rep Statistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Statistics x -> Statistics
$cfrom :: forall x. Statistics -> Rep Statistics x
Prelude.Generic)

-- |
-- Create a value of 'Statistics' 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:
--
-- 'approximateNumberOfObjectsToProcess', 'statistics_approximateNumberOfObjectsToProcess' - The approximate number of objects that the job has yet to process during
-- its current run.
--
-- 'numberOfRuns', 'statistics_numberOfRuns' - The number of times that the job has run.
newStatistics ::
  Statistics
newStatistics :: Statistics
newStatistics =
  Statistics'
    { $sel:approximateNumberOfObjectsToProcess:Statistics' :: Maybe Double
approximateNumberOfObjectsToProcess =
        forall a. Maybe a
Prelude.Nothing,
      $sel:numberOfRuns:Statistics' :: Maybe Double
numberOfRuns = forall a. Maybe a
Prelude.Nothing
    }

-- | The approximate number of objects that the job has yet to process during
-- its current run.
statistics_approximateNumberOfObjectsToProcess :: Lens.Lens' Statistics (Prelude.Maybe Prelude.Double)
statistics_approximateNumberOfObjectsToProcess :: Lens' Statistics (Maybe Double)
statistics_approximateNumberOfObjectsToProcess = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Statistics' {Maybe Double
approximateNumberOfObjectsToProcess :: Maybe Double
$sel:approximateNumberOfObjectsToProcess:Statistics' :: Statistics -> Maybe Double
approximateNumberOfObjectsToProcess} -> Maybe Double
approximateNumberOfObjectsToProcess) (\s :: Statistics
s@Statistics' {} Maybe Double
a -> Statistics
s {$sel:approximateNumberOfObjectsToProcess:Statistics' :: Maybe Double
approximateNumberOfObjectsToProcess = Maybe Double
a} :: Statistics)

-- | The number of times that the job has run.
statistics_numberOfRuns :: Lens.Lens' Statistics (Prelude.Maybe Prelude.Double)
statistics_numberOfRuns :: Lens' Statistics (Maybe Double)
statistics_numberOfRuns = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Statistics' {Maybe Double
numberOfRuns :: Maybe Double
$sel:numberOfRuns:Statistics' :: Statistics -> Maybe Double
numberOfRuns} -> Maybe Double
numberOfRuns) (\s :: Statistics
s@Statistics' {} Maybe Double
a -> Statistics
s {$sel:numberOfRuns:Statistics' :: Maybe Double
numberOfRuns = Maybe Double
a} :: Statistics)

instance Data.FromJSON Statistics where
  parseJSON :: Value -> Parser Statistics
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"Statistics"
      ( \Object
x ->
          Maybe Double -> Maybe Double -> Statistics
Statistics'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"approximateNumberOfObjectsToProcess")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"numberOfRuns")
      )

instance Prelude.Hashable Statistics where
  hashWithSalt :: Int -> Statistics -> Int
hashWithSalt Int
_salt Statistics' {Maybe Double
numberOfRuns :: Maybe Double
approximateNumberOfObjectsToProcess :: Maybe Double
$sel:numberOfRuns:Statistics' :: Statistics -> Maybe Double
$sel:approximateNumberOfObjectsToProcess:Statistics' :: Statistics -> Maybe Double
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
approximateNumberOfObjectsToProcess
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
numberOfRuns

instance Prelude.NFData Statistics where
  rnf :: Statistics -> ()
rnf Statistics' {Maybe Double
numberOfRuns :: Maybe Double
approximateNumberOfObjectsToProcess :: Maybe Double
$sel:numberOfRuns:Statistics' :: Statistics -> Maybe Double
$sel:approximateNumberOfObjectsToProcess:Statistics' :: Statistics -> Maybe Double
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
approximateNumberOfObjectsToProcess
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
numberOfRuns