{-# 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.ObjectLevelStatistics
-- 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.ObjectLevelStatistics 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 information about the total storage size (in bytes) or number
-- of objects that Amazon Macie can\'t analyze in one or more S3 buckets.
-- In a BucketMetadata or MatchingBucket object, this data is for a
-- specific bucket. In a GetBucketStatisticsResponse object, this data is
-- aggregated for all the buckets in the query results. If versioning is
-- enabled for a bucket, storage size values are based on the size of the
-- latest version of each applicable object in the bucket.
--
-- /See:/ 'newObjectLevelStatistics' smart constructor.
data ObjectLevelStatistics = ObjectLevelStatistics'
  { -- | The total storage size (in bytes) or number of objects that Amazon Macie
    -- can\'t analyze because the objects don\'t have a file name extension for
    -- a supported file or storage format.
    ObjectLevelStatistics -> Maybe Integer
fileType :: Prelude.Maybe Prelude.Integer,
    -- | The total storage size (in bytes) or number of objects that Amazon Macie
    -- can\'t analyze because the objects use an unsupported storage class.
    ObjectLevelStatistics -> Maybe Integer
storageClass :: Prelude.Maybe Prelude.Integer,
    -- | The total storage size (in bytes) or number of objects that Amazon Macie
    -- can\'t analyze because the objects use an unsupported storage class or
    -- don\'t have a file name extension for a supported file or storage
    -- format.
    ObjectLevelStatistics -> Maybe Integer
total :: Prelude.Maybe Prelude.Integer
  }
  deriving (ObjectLevelStatistics -> ObjectLevelStatistics -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ObjectLevelStatistics -> ObjectLevelStatistics -> Bool
$c/= :: ObjectLevelStatistics -> ObjectLevelStatistics -> Bool
== :: ObjectLevelStatistics -> ObjectLevelStatistics -> Bool
$c== :: ObjectLevelStatistics -> ObjectLevelStatistics -> Bool
Prelude.Eq, ReadPrec [ObjectLevelStatistics]
ReadPrec ObjectLevelStatistics
Int -> ReadS ObjectLevelStatistics
ReadS [ObjectLevelStatistics]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ObjectLevelStatistics]
$creadListPrec :: ReadPrec [ObjectLevelStatistics]
readPrec :: ReadPrec ObjectLevelStatistics
$creadPrec :: ReadPrec ObjectLevelStatistics
readList :: ReadS [ObjectLevelStatistics]
$creadList :: ReadS [ObjectLevelStatistics]
readsPrec :: Int -> ReadS ObjectLevelStatistics
$creadsPrec :: Int -> ReadS ObjectLevelStatistics
Prelude.Read, Int -> ObjectLevelStatistics -> ShowS
[ObjectLevelStatistics] -> ShowS
ObjectLevelStatistics -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ObjectLevelStatistics] -> ShowS
$cshowList :: [ObjectLevelStatistics] -> ShowS
show :: ObjectLevelStatistics -> String
$cshow :: ObjectLevelStatistics -> String
showsPrec :: Int -> ObjectLevelStatistics -> ShowS
$cshowsPrec :: Int -> ObjectLevelStatistics -> ShowS
Prelude.Show, forall x. Rep ObjectLevelStatistics x -> ObjectLevelStatistics
forall x. ObjectLevelStatistics -> Rep ObjectLevelStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ObjectLevelStatistics x -> ObjectLevelStatistics
$cfrom :: forall x. ObjectLevelStatistics -> Rep ObjectLevelStatistics x
Prelude.Generic)

-- |
-- Create a value of 'ObjectLevelStatistics' 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:
--
-- 'fileType', 'objectLevelStatistics_fileType' - The total storage size (in bytes) or number of objects that Amazon Macie
-- can\'t analyze because the objects don\'t have a file name extension for
-- a supported file or storage format.
--
-- 'storageClass', 'objectLevelStatistics_storageClass' - The total storage size (in bytes) or number of objects that Amazon Macie
-- can\'t analyze because the objects use an unsupported storage class.
--
-- 'total', 'objectLevelStatistics_total' - The total storage size (in bytes) or number of objects that Amazon Macie
-- can\'t analyze because the objects use an unsupported storage class or
-- don\'t have a file name extension for a supported file or storage
-- format.
newObjectLevelStatistics ::
  ObjectLevelStatistics
newObjectLevelStatistics :: ObjectLevelStatistics
newObjectLevelStatistics =
  ObjectLevelStatistics'
    { $sel:fileType:ObjectLevelStatistics' :: Maybe Integer
fileType = forall a. Maybe a
Prelude.Nothing,
      $sel:storageClass:ObjectLevelStatistics' :: Maybe Integer
storageClass = forall a. Maybe a
Prelude.Nothing,
      $sel:total:ObjectLevelStatistics' :: Maybe Integer
total = forall a. Maybe a
Prelude.Nothing
    }

-- | The total storage size (in bytes) or number of objects that Amazon Macie
-- can\'t analyze because the objects don\'t have a file name extension for
-- a supported file or storage format.
objectLevelStatistics_fileType :: Lens.Lens' ObjectLevelStatistics (Prelude.Maybe Prelude.Integer)
objectLevelStatistics_fileType :: Lens' ObjectLevelStatistics (Maybe Integer)
objectLevelStatistics_fileType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectLevelStatistics' {Maybe Integer
fileType :: Maybe Integer
$sel:fileType:ObjectLevelStatistics' :: ObjectLevelStatistics -> Maybe Integer
fileType} -> Maybe Integer
fileType) (\s :: ObjectLevelStatistics
s@ObjectLevelStatistics' {} Maybe Integer
a -> ObjectLevelStatistics
s {$sel:fileType:ObjectLevelStatistics' :: Maybe Integer
fileType = Maybe Integer
a} :: ObjectLevelStatistics)

-- | The total storage size (in bytes) or number of objects that Amazon Macie
-- can\'t analyze because the objects use an unsupported storage class.
objectLevelStatistics_storageClass :: Lens.Lens' ObjectLevelStatistics (Prelude.Maybe Prelude.Integer)
objectLevelStatistics_storageClass :: Lens' ObjectLevelStatistics (Maybe Integer)
objectLevelStatistics_storageClass = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectLevelStatistics' {Maybe Integer
storageClass :: Maybe Integer
$sel:storageClass:ObjectLevelStatistics' :: ObjectLevelStatistics -> Maybe Integer
storageClass} -> Maybe Integer
storageClass) (\s :: ObjectLevelStatistics
s@ObjectLevelStatistics' {} Maybe Integer
a -> ObjectLevelStatistics
s {$sel:storageClass:ObjectLevelStatistics' :: Maybe Integer
storageClass = Maybe Integer
a} :: ObjectLevelStatistics)

-- | The total storage size (in bytes) or number of objects that Amazon Macie
-- can\'t analyze because the objects use an unsupported storage class or
-- don\'t have a file name extension for a supported file or storage
-- format.
objectLevelStatistics_total :: Lens.Lens' ObjectLevelStatistics (Prelude.Maybe Prelude.Integer)
objectLevelStatistics_total :: Lens' ObjectLevelStatistics (Maybe Integer)
objectLevelStatistics_total = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectLevelStatistics' {Maybe Integer
total :: Maybe Integer
$sel:total:ObjectLevelStatistics' :: ObjectLevelStatistics -> Maybe Integer
total} -> Maybe Integer
total) (\s :: ObjectLevelStatistics
s@ObjectLevelStatistics' {} Maybe Integer
a -> ObjectLevelStatistics
s {$sel:total:ObjectLevelStatistics' :: Maybe Integer
total = Maybe Integer
a} :: ObjectLevelStatistics)

instance Data.FromJSON ObjectLevelStatistics where
  parseJSON :: Value -> Parser ObjectLevelStatistics
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ObjectLevelStatistics"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer -> Maybe Integer -> ObjectLevelStatistics
ObjectLevelStatistics'
            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
"fileType")
            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
"storageClass")
            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
"total")
      )

instance Prelude.Hashable ObjectLevelStatistics where
  hashWithSalt :: Int -> ObjectLevelStatistics -> Int
hashWithSalt Int
_salt ObjectLevelStatistics' {Maybe Integer
total :: Maybe Integer
storageClass :: Maybe Integer
fileType :: Maybe Integer
$sel:total:ObjectLevelStatistics' :: ObjectLevelStatistics -> Maybe Integer
$sel:storageClass:ObjectLevelStatistics' :: ObjectLevelStatistics -> Maybe Integer
$sel:fileType:ObjectLevelStatistics' :: ObjectLevelStatistics -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
fileType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
storageClass
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
total

instance Prelude.NFData ObjectLevelStatistics where
  rnf :: ObjectLevelStatistics -> ()
rnf ObjectLevelStatistics' {Maybe Integer
total :: Maybe Integer
storageClass :: Maybe Integer
fileType :: Maybe Integer
$sel:total:ObjectLevelStatistics' :: ObjectLevelStatistics -> Maybe Integer
$sel:storageClass:ObjectLevelStatistics' :: ObjectLevelStatistics -> Maybe Integer
$sel:fileType:ObjectLevelStatistics' :: ObjectLevelStatistics -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
fileType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
storageClass
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
total