{-# 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-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.MacieV2.Types.ObjectLevelStatistics where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 the buckets in the query results. If versioning is
-- enabled for a bucket, total 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
(ObjectLevelStatistics -> ObjectLevelStatistics -> Bool)
-> (ObjectLevelStatistics -> ObjectLevelStatistics -> Bool)
-> Eq ObjectLevelStatistics
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]
(Int -> ReadS ObjectLevelStatistics)
-> ReadS [ObjectLevelStatistics]
-> ReadPrec ObjectLevelStatistics
-> ReadPrec [ObjectLevelStatistics]
-> Read 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
(Int -> ObjectLevelStatistics -> ShowS)
-> (ObjectLevelStatistics -> String)
-> ([ObjectLevelStatistics] -> ShowS)
-> Show ObjectLevelStatistics
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. ObjectLevelStatistics -> Rep ObjectLevelStatistics x)
-> (forall x. Rep ObjectLevelStatistics x -> ObjectLevelStatistics)
-> Generic ObjectLevelStatistics
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' :: Maybe Integer
-> Maybe Integer -> Maybe Integer -> ObjectLevelStatistics
ObjectLevelStatistics'
    { $sel:fileType:ObjectLevelStatistics' :: Maybe Integer
fileType = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:storageClass:ObjectLevelStatistics' :: Maybe Integer
storageClass = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:total:ObjectLevelStatistics' :: Maybe Integer
total = Maybe Integer
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 :: (Maybe Integer -> f (Maybe Integer))
-> ObjectLevelStatistics -> f ObjectLevelStatistics
objectLevelStatistics_fileType = (ObjectLevelStatistics -> Maybe Integer)
-> (ObjectLevelStatistics
    -> Maybe Integer -> ObjectLevelStatistics)
-> Lens
     ObjectLevelStatistics
     ObjectLevelStatistics
     (Maybe Integer)
     (Maybe Integer)
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 :: (Maybe Integer -> f (Maybe Integer))
-> ObjectLevelStatistics -> f ObjectLevelStatistics
objectLevelStatistics_storageClass = (ObjectLevelStatistics -> Maybe Integer)
-> (ObjectLevelStatistics
    -> Maybe Integer -> ObjectLevelStatistics)
-> Lens
     ObjectLevelStatistics
     ObjectLevelStatistics
     (Maybe Integer)
     (Maybe Integer)
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 :: (Maybe Integer -> f (Maybe Integer))
-> ObjectLevelStatistics -> f ObjectLevelStatistics
objectLevelStatistics_total = (ObjectLevelStatistics -> Maybe Integer)
-> (ObjectLevelStatistics
    -> Maybe Integer -> ObjectLevelStatistics)
-> Lens
     ObjectLevelStatistics
     ObjectLevelStatistics
     (Maybe Integer)
     (Maybe Integer)
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 Core.FromJSON ObjectLevelStatistics where
  parseJSON :: Value -> Parser ObjectLevelStatistics
parseJSON =
    String
-> (Object -> Parser ObjectLevelStatistics)
-> Value
-> Parser ObjectLevelStatistics
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ObjectLevelStatistics"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer -> Maybe Integer -> ObjectLevelStatistics
ObjectLevelStatistics'
            (Maybe Integer
 -> Maybe Integer -> Maybe Integer -> ObjectLevelStatistics)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> Maybe Integer -> ObjectLevelStatistics)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"fileType")
            Parser (Maybe Integer -> Maybe Integer -> ObjectLevelStatistics)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> ObjectLevelStatistics)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"storageClass")
            Parser (Maybe Integer -> ObjectLevelStatistics)
-> Parser (Maybe Integer) -> Parser ObjectLevelStatistics
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"total")
      )

instance Prelude.Hashable ObjectLevelStatistics

instance Prelude.NFData ObjectLevelStatistics