{-# 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.SensitivityAggregations
-- 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.SensitivityAggregations 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 aggregated statistical data for sensitive data discovery
-- metrics that apply to S3 buckets. Each field contains aggregated data
-- for all the buckets that have a sensitivity score (sensitivityScore) of
-- a specified value or within a specified range
-- (BucketStatisticsBySensitivity). If automated sensitive data discovery
-- is currently disabled for your account, the value for each field is 0.
--
-- /See:/ 'newSensitivityAggregations' smart constructor.
data SensitivityAggregations = SensitivityAggregations'
  { -- | The total storage size, in bytes, of all the objects that Amazon Macie
    -- can analyze in the buckets. These objects use a supported storage class
    -- and have a file name extension for a supported file or storage format.
    --
    -- If versioning is enabled for any of the buckets, this value is based on
    -- the size of the latest version of each applicable object in the buckets.
    -- This value doesn\'t reflect the storage size of all versions of all
    -- applicable objects in the buckets.
    SensitivityAggregations -> Maybe Integer
classifiableSizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets that are publicly accessible based on a
    -- combination of permissions settings for each bucket.
    SensitivityAggregations -> Maybe Integer
publiclyAccessibleCount :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets.
    SensitivityAggregations -> Maybe Integer
totalCount :: Prelude.Maybe Prelude.Integer,
    -- | The total storage size, in bytes, of the buckets.
    --
    -- If versioning is enabled for any of the buckets, this value is based on
    -- the size of the latest version of each object in the buckets. This value
    -- doesn\'t reflect the storage size of all versions of the objects in the
    -- buckets.
    SensitivityAggregations -> Maybe Integer
totalSizeInBytes :: Prelude.Maybe Prelude.Integer
  }
  deriving (SensitivityAggregations -> SensitivityAggregations -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SensitivityAggregations -> SensitivityAggregations -> Bool
$c/= :: SensitivityAggregations -> SensitivityAggregations -> Bool
== :: SensitivityAggregations -> SensitivityAggregations -> Bool
$c== :: SensitivityAggregations -> SensitivityAggregations -> Bool
Prelude.Eq, ReadPrec [SensitivityAggregations]
ReadPrec SensitivityAggregations
Int -> ReadS SensitivityAggregations
ReadS [SensitivityAggregations]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SensitivityAggregations]
$creadListPrec :: ReadPrec [SensitivityAggregations]
readPrec :: ReadPrec SensitivityAggregations
$creadPrec :: ReadPrec SensitivityAggregations
readList :: ReadS [SensitivityAggregations]
$creadList :: ReadS [SensitivityAggregations]
readsPrec :: Int -> ReadS SensitivityAggregations
$creadsPrec :: Int -> ReadS SensitivityAggregations
Prelude.Read, Int -> SensitivityAggregations -> ShowS
[SensitivityAggregations] -> ShowS
SensitivityAggregations -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SensitivityAggregations] -> ShowS
$cshowList :: [SensitivityAggregations] -> ShowS
show :: SensitivityAggregations -> String
$cshow :: SensitivityAggregations -> String
showsPrec :: Int -> SensitivityAggregations -> ShowS
$cshowsPrec :: Int -> SensitivityAggregations -> ShowS
Prelude.Show, forall x. Rep SensitivityAggregations x -> SensitivityAggregations
forall x. SensitivityAggregations -> Rep SensitivityAggregations x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SensitivityAggregations x -> SensitivityAggregations
$cfrom :: forall x. SensitivityAggregations -> Rep SensitivityAggregations x
Prelude.Generic)

-- |
-- Create a value of 'SensitivityAggregations' 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:
--
-- 'classifiableSizeInBytes', 'sensitivityAggregations_classifiableSizeInBytes' - The total storage size, in bytes, of all the objects that Amazon Macie
-- can analyze in the buckets. These objects use a supported storage class
-- and have a file name extension for a supported file or storage format.
--
-- If versioning is enabled for any of the buckets, this value is based on
-- the size of the latest version of each applicable object in the buckets.
-- This value doesn\'t reflect the storage size of all versions of all
-- applicable objects in the buckets.
--
-- 'publiclyAccessibleCount', 'sensitivityAggregations_publiclyAccessibleCount' - The total number of buckets that are publicly accessible based on a
-- combination of permissions settings for each bucket.
--
-- 'totalCount', 'sensitivityAggregations_totalCount' - The total number of buckets.
--
-- 'totalSizeInBytes', 'sensitivityAggregations_totalSizeInBytes' - The total storage size, in bytes, of the buckets.
--
-- If versioning is enabled for any of the buckets, this value is based on
-- the size of the latest version of each object in the buckets. This value
-- doesn\'t reflect the storage size of all versions of the objects in the
-- buckets.
newSensitivityAggregations ::
  SensitivityAggregations
newSensitivityAggregations :: SensitivityAggregations
newSensitivityAggregations =
  SensitivityAggregations'
    { $sel:classifiableSizeInBytes:SensitivityAggregations' :: Maybe Integer
classifiableSizeInBytes =
        forall a. Maybe a
Prelude.Nothing,
      $sel:publiclyAccessibleCount:SensitivityAggregations' :: Maybe Integer
publiclyAccessibleCount = forall a. Maybe a
Prelude.Nothing,
      $sel:totalCount:SensitivityAggregations' :: Maybe Integer
totalCount = forall a. Maybe a
Prelude.Nothing,
      $sel:totalSizeInBytes:SensitivityAggregations' :: Maybe Integer
totalSizeInBytes = forall a. Maybe a
Prelude.Nothing
    }

-- | The total storage size, in bytes, of all the objects that Amazon Macie
-- can analyze in the buckets. These objects use a supported storage class
-- and have a file name extension for a supported file or storage format.
--
-- If versioning is enabled for any of the buckets, this value is based on
-- the size of the latest version of each applicable object in the buckets.
-- This value doesn\'t reflect the storage size of all versions of all
-- applicable objects in the buckets.
sensitivityAggregations_classifiableSizeInBytes :: Lens.Lens' SensitivityAggregations (Prelude.Maybe Prelude.Integer)
sensitivityAggregations_classifiableSizeInBytes :: Lens' SensitivityAggregations (Maybe Integer)
sensitivityAggregations_classifiableSizeInBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SensitivityAggregations' {Maybe Integer
classifiableSizeInBytes :: Maybe Integer
$sel:classifiableSizeInBytes:SensitivityAggregations' :: SensitivityAggregations -> Maybe Integer
classifiableSizeInBytes} -> Maybe Integer
classifiableSizeInBytes) (\s :: SensitivityAggregations
s@SensitivityAggregations' {} Maybe Integer
a -> SensitivityAggregations
s {$sel:classifiableSizeInBytes:SensitivityAggregations' :: Maybe Integer
classifiableSizeInBytes = Maybe Integer
a} :: SensitivityAggregations)

-- | The total number of buckets that are publicly accessible based on a
-- combination of permissions settings for each bucket.
sensitivityAggregations_publiclyAccessibleCount :: Lens.Lens' SensitivityAggregations (Prelude.Maybe Prelude.Integer)
sensitivityAggregations_publiclyAccessibleCount :: Lens' SensitivityAggregations (Maybe Integer)
sensitivityAggregations_publiclyAccessibleCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SensitivityAggregations' {Maybe Integer
publiclyAccessibleCount :: Maybe Integer
$sel:publiclyAccessibleCount:SensitivityAggregations' :: SensitivityAggregations -> Maybe Integer
publiclyAccessibleCount} -> Maybe Integer
publiclyAccessibleCount) (\s :: SensitivityAggregations
s@SensitivityAggregations' {} Maybe Integer
a -> SensitivityAggregations
s {$sel:publiclyAccessibleCount:SensitivityAggregations' :: Maybe Integer
publiclyAccessibleCount = Maybe Integer
a} :: SensitivityAggregations)

-- | The total number of buckets.
sensitivityAggregations_totalCount :: Lens.Lens' SensitivityAggregations (Prelude.Maybe Prelude.Integer)
sensitivityAggregations_totalCount :: Lens' SensitivityAggregations (Maybe Integer)
sensitivityAggregations_totalCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SensitivityAggregations' {Maybe Integer
totalCount :: Maybe Integer
$sel:totalCount:SensitivityAggregations' :: SensitivityAggregations -> Maybe Integer
totalCount} -> Maybe Integer
totalCount) (\s :: SensitivityAggregations
s@SensitivityAggregations' {} Maybe Integer
a -> SensitivityAggregations
s {$sel:totalCount:SensitivityAggregations' :: Maybe Integer
totalCount = Maybe Integer
a} :: SensitivityAggregations)

-- | The total storage size, in bytes, of the buckets.
--
-- If versioning is enabled for any of the buckets, this value is based on
-- the size of the latest version of each object in the buckets. This value
-- doesn\'t reflect the storage size of all versions of the objects in the
-- buckets.
sensitivityAggregations_totalSizeInBytes :: Lens.Lens' SensitivityAggregations (Prelude.Maybe Prelude.Integer)
sensitivityAggregations_totalSizeInBytes :: Lens' SensitivityAggregations (Maybe Integer)
sensitivityAggregations_totalSizeInBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SensitivityAggregations' {Maybe Integer
totalSizeInBytes :: Maybe Integer
$sel:totalSizeInBytes:SensitivityAggregations' :: SensitivityAggregations -> Maybe Integer
totalSizeInBytes} -> Maybe Integer
totalSizeInBytes) (\s :: SensitivityAggregations
s@SensitivityAggregations' {} Maybe Integer
a -> SensitivityAggregations
s {$sel:totalSizeInBytes:SensitivityAggregations' :: Maybe Integer
totalSizeInBytes = Maybe Integer
a} :: SensitivityAggregations)

instance Data.FromJSON SensitivityAggregations where
  parseJSON :: Value -> Parser SensitivityAggregations
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"SensitivityAggregations"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> SensitivityAggregations
SensitivityAggregations'
            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
"classifiableSizeInBytes")
            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
"publiclyAccessibleCount")
            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
"totalCount")
            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
"totalSizeInBytes")
      )

instance Prelude.Hashable SensitivityAggregations where
  hashWithSalt :: Int -> SensitivityAggregations -> Int
hashWithSalt Int
_salt SensitivityAggregations' {Maybe Integer
totalSizeInBytes :: Maybe Integer
totalCount :: Maybe Integer
publiclyAccessibleCount :: Maybe Integer
classifiableSizeInBytes :: Maybe Integer
$sel:totalSizeInBytes:SensitivityAggregations' :: SensitivityAggregations -> Maybe Integer
$sel:totalCount:SensitivityAggregations' :: SensitivityAggregations -> Maybe Integer
$sel:publiclyAccessibleCount:SensitivityAggregations' :: SensitivityAggregations -> Maybe Integer
$sel:classifiableSizeInBytes:SensitivityAggregations' :: SensitivityAggregations -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
classifiableSizeInBytes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
publiclyAccessibleCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
totalCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
totalSizeInBytes

instance Prelude.NFData SensitivityAggregations where
  rnf :: SensitivityAggregations -> ()
rnf SensitivityAggregations' {Maybe Integer
totalSizeInBytes :: Maybe Integer
totalCount :: Maybe Integer
publiclyAccessibleCount :: Maybe Integer
classifiableSizeInBytes :: Maybe Integer
$sel:totalSizeInBytes:SensitivityAggregations' :: SensitivityAggregations -> Maybe Integer
$sel:totalCount:SensitivityAggregations' :: SensitivityAggregations -> Maybe Integer
$sel:publiclyAccessibleCount:SensitivityAggregations' :: SensitivityAggregations -> Maybe Integer
$sel:classifiableSizeInBytes:SensitivityAggregations' :: SensitivityAggregations -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
classifiableSizeInBytes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
publiclyAccessibleCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
totalCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
totalSizeInBytes