{-# 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.GuardDuty.Types.ScannedItemCount
-- 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.GuardDuty.Types.ScannedItemCount 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

-- | Total number of scanned files.
--
-- /See:/ 'newScannedItemCount' smart constructor.
data ScannedItemCount = ScannedItemCount'
  { -- | Number of files scanned.
    ScannedItemCount -> Maybe Int
files :: Prelude.Maybe Prelude.Int,
    -- | Total GB of files scanned for malware.
    ScannedItemCount -> Maybe Int
totalGb :: Prelude.Maybe Prelude.Int,
    -- | Total number of scanned volumes.
    ScannedItemCount -> Maybe Int
volumes :: Prelude.Maybe Prelude.Int
  }
  deriving (ScannedItemCount -> ScannedItemCount -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScannedItemCount -> ScannedItemCount -> Bool
$c/= :: ScannedItemCount -> ScannedItemCount -> Bool
== :: ScannedItemCount -> ScannedItemCount -> Bool
$c== :: ScannedItemCount -> ScannedItemCount -> Bool
Prelude.Eq, ReadPrec [ScannedItemCount]
ReadPrec ScannedItemCount
Int -> ReadS ScannedItemCount
ReadS [ScannedItemCount]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScannedItemCount]
$creadListPrec :: ReadPrec [ScannedItemCount]
readPrec :: ReadPrec ScannedItemCount
$creadPrec :: ReadPrec ScannedItemCount
readList :: ReadS [ScannedItemCount]
$creadList :: ReadS [ScannedItemCount]
readsPrec :: Int -> ReadS ScannedItemCount
$creadsPrec :: Int -> ReadS ScannedItemCount
Prelude.Read, Int -> ScannedItemCount -> ShowS
[ScannedItemCount] -> ShowS
ScannedItemCount -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScannedItemCount] -> ShowS
$cshowList :: [ScannedItemCount] -> ShowS
show :: ScannedItemCount -> String
$cshow :: ScannedItemCount -> String
showsPrec :: Int -> ScannedItemCount -> ShowS
$cshowsPrec :: Int -> ScannedItemCount -> ShowS
Prelude.Show, forall x. Rep ScannedItemCount x -> ScannedItemCount
forall x. ScannedItemCount -> Rep ScannedItemCount x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScannedItemCount x -> ScannedItemCount
$cfrom :: forall x. ScannedItemCount -> Rep ScannedItemCount x
Prelude.Generic)

-- |
-- Create a value of 'ScannedItemCount' 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:
--
-- 'files', 'scannedItemCount_files' - Number of files scanned.
--
-- 'totalGb', 'scannedItemCount_totalGb' - Total GB of files scanned for malware.
--
-- 'volumes', 'scannedItemCount_volumes' - Total number of scanned volumes.
newScannedItemCount ::
  ScannedItemCount
newScannedItemCount :: ScannedItemCount
newScannedItemCount =
  ScannedItemCount'
    { $sel:files:ScannedItemCount' :: Maybe Int
files = forall a. Maybe a
Prelude.Nothing,
      $sel:totalGb:ScannedItemCount' :: Maybe Int
totalGb = forall a. Maybe a
Prelude.Nothing,
      $sel:volumes:ScannedItemCount' :: Maybe Int
volumes = forall a. Maybe a
Prelude.Nothing
    }

-- | Number of files scanned.
scannedItemCount_files :: Lens.Lens' ScannedItemCount (Prelude.Maybe Prelude.Int)
scannedItemCount_files :: Lens' ScannedItemCount (Maybe Int)
scannedItemCount_files = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScannedItemCount' {Maybe Int
files :: Maybe Int
$sel:files:ScannedItemCount' :: ScannedItemCount -> Maybe Int
files} -> Maybe Int
files) (\s :: ScannedItemCount
s@ScannedItemCount' {} Maybe Int
a -> ScannedItemCount
s {$sel:files:ScannedItemCount' :: Maybe Int
files = Maybe Int
a} :: ScannedItemCount)

-- | Total GB of files scanned for malware.
scannedItemCount_totalGb :: Lens.Lens' ScannedItemCount (Prelude.Maybe Prelude.Int)
scannedItemCount_totalGb :: Lens' ScannedItemCount (Maybe Int)
scannedItemCount_totalGb = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScannedItemCount' {Maybe Int
totalGb :: Maybe Int
$sel:totalGb:ScannedItemCount' :: ScannedItemCount -> Maybe Int
totalGb} -> Maybe Int
totalGb) (\s :: ScannedItemCount
s@ScannedItemCount' {} Maybe Int
a -> ScannedItemCount
s {$sel:totalGb:ScannedItemCount' :: Maybe Int
totalGb = Maybe Int
a} :: ScannedItemCount)

-- | Total number of scanned volumes.
scannedItemCount_volumes :: Lens.Lens' ScannedItemCount (Prelude.Maybe Prelude.Int)
scannedItemCount_volumes :: Lens' ScannedItemCount (Maybe Int)
scannedItemCount_volumes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScannedItemCount' {Maybe Int
volumes :: Maybe Int
$sel:volumes:ScannedItemCount' :: ScannedItemCount -> Maybe Int
volumes} -> Maybe Int
volumes) (\s :: ScannedItemCount
s@ScannedItemCount' {} Maybe Int
a -> ScannedItemCount
s {$sel:volumes:ScannedItemCount' :: Maybe Int
volumes = Maybe Int
a} :: ScannedItemCount)

instance Data.FromJSON ScannedItemCount where
  parseJSON :: Value -> Parser ScannedItemCount
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ScannedItemCount"
      ( \Object
x ->
          Maybe Int -> Maybe Int -> Maybe Int -> ScannedItemCount
ScannedItemCount'
            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
"files")
            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
"totalGb")
            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
"volumes")
      )

instance Prelude.Hashable ScannedItemCount where
  hashWithSalt :: Int -> ScannedItemCount -> Int
hashWithSalt Int
_salt ScannedItemCount' {Maybe Int
volumes :: Maybe Int
totalGb :: Maybe Int
files :: Maybe Int
$sel:volumes:ScannedItemCount' :: ScannedItemCount -> Maybe Int
$sel:totalGb:ScannedItemCount' :: ScannedItemCount -> Maybe Int
$sel:files:ScannedItemCount' :: ScannedItemCount -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
files
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
totalGb
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
volumes

instance Prelude.NFData ScannedItemCount where
  rnf :: ScannedItemCount -> ()
rnf ScannedItemCount' {Maybe Int
volumes :: Maybe Int
totalGb :: Maybe Int
files :: Maybe Int
$sel:volumes:ScannedItemCount' :: ScannedItemCount -> Maybe Int
$sel:totalGb:ScannedItemCount' :: ScannedItemCount -> Maybe Int
$sel:files:ScannedItemCount' :: ScannedItemCount -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
files
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
totalGb
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
volumes