{-# 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.MatchingBucket
-- 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.MatchingBucket where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MacieV2.Types.BucketMetadataErrorCode
import Amazonka.MacieV2.Types.JobDetails
import Amazonka.MacieV2.Types.ObjectCountByEncryptionType
import Amazonka.MacieV2.Types.ObjectLevelStatistics
import qualified Amazonka.Prelude as Prelude

-- | Provides statistical data and other information about an S3 bucket that
-- Amazon Macie monitors and analyzes for your account. If an error occurs
-- when Macie attempts to retrieve and process information about the bucket
-- or the bucket\'s objects, the value for most of these properties is
-- null. Key exceptions are accountId and bucketName. To identify the cause
-- of the error, refer to the errorCode and errorMessage values.
--
-- /See:/ 'newMatchingBucket' smart constructor.
data MatchingBucket = MatchingBucket'
  { -- | The unique identifier for the Amazon Web Services account that owns the
    -- bucket.
    MatchingBucket -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | The name of the bucket.
    MatchingBucket -> Maybe Text
bucketName :: Prelude.Maybe Prelude.Text,
    -- | The total number of objects that Amazon Macie can analyze in the bucket.
    -- These objects use a supported storage class and have a file name
    -- extension for a supported file or storage format.
    MatchingBucket -> Maybe Integer
classifiableObjectCount :: Prelude.Maybe Prelude.Integer,
    -- | The total storage size, in bytes, of the objects that Amazon Macie can
    -- analyze in the bucket. 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 the bucket, Macie calculates this value
    -- based on the size of the latest version of each applicable object in the
    -- bucket. This value doesn\'t reflect the storage size of all versions of
    -- each applicable object in the bucket.
    MatchingBucket -> Maybe Integer
classifiableSizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | Specifies the error code for an error that prevented Amazon Macie from
    -- retrieving and processing information about the bucket and the bucket\'s
    -- objects. If this value is ACCESS_DENIED, Macie doesn\'t have permission
    -- to retrieve the information. For example, the bucket has a restrictive
    -- bucket policy and Amazon S3 denied the request. If this value is null,
    -- Macie was able to retrieve and process the information.
    MatchingBucket -> Maybe BucketMetadataErrorCode
errorCode :: Prelude.Maybe BucketMetadataErrorCode,
    -- | A brief description of the error (errorCode) that prevented Amazon Macie
    -- from retrieving and processing information about the bucket and the
    -- bucket\'s objects. This value is null if Macie was able to retrieve and
    -- process the information.
    MatchingBucket -> Maybe Text
errorMessage :: Prelude.Maybe Prelude.Text,
    -- | Specifies whether any one-time or recurring classification jobs are
    -- configured to analyze objects in the bucket, and, if so, the details of
    -- the job that ran most recently.
    MatchingBucket -> Maybe JobDetails
jobDetails :: Prelude.Maybe JobDetails,
    -- | The date and time, in UTC and extended ISO 8601 format, when Amazon
    -- Macie most recently performed automated sensitive data discovery for the
    -- bucket. This value is null if automated sensitive data discovery is
    -- currently disabled for your account.
    MatchingBucket -> Maybe ISO8601
lastAutomatedDiscoveryTime :: Prelude.Maybe Data.ISO8601,
    -- | The total number of objects in the bucket.
    MatchingBucket -> Maybe Integer
objectCount :: Prelude.Maybe Prelude.Integer,
    -- | The total number of objects in the bucket, grouped by server-side
    -- encryption type. This includes a grouping that reports the total number
    -- of objects that aren\'t encrypted or use client-side encryption.
    MatchingBucket -> Maybe ObjectCountByEncryptionType
objectCountByEncryptionType :: Prelude.Maybe ObjectCountByEncryptionType,
    -- | The current sensitivity score for the bucket, ranging from -1 (no
    -- analysis due to an error) to 100 (sensitive). This value is null if
    -- automated sensitive data discovery is currently disabled for your
    -- account.
    MatchingBucket -> Maybe Int
sensitivityScore :: Prelude.Maybe Prelude.Int,
    -- | The total storage size, in bytes, of the bucket.
    --
    -- If versioning is enabled for the bucket, Amazon Macie calculates this
    -- value based on the size of the latest version of each object in the
    -- bucket. This value doesn\'t reflect the storage size of all versions of
    -- each object in the bucket.
    MatchingBucket -> Maybe Integer
sizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The total storage size, in bytes, of the objects that are compressed
    -- (.gz, .gzip, .zip) files in the bucket.
    --
    -- If versioning is enabled for the bucket, Amazon Macie calculates this
    -- value based on the size of the latest version of each applicable object
    -- in the bucket. This value doesn\'t reflect the storage size of all
    -- versions of each applicable object in the bucket.
    MatchingBucket -> Maybe Integer
sizeInBytesCompressed :: Prelude.Maybe Prelude.Integer,
    -- | The total number of objects that Amazon Macie can\'t analyze in the
    -- bucket. These objects don\'t use a supported storage class or don\'t
    -- have a file name extension for a supported file or storage format.
    MatchingBucket -> Maybe ObjectLevelStatistics
unclassifiableObjectCount :: Prelude.Maybe ObjectLevelStatistics,
    -- | The total storage size, in bytes, of the objects that Amazon Macie
    -- can\'t analyze in the bucket. These objects don\'t use a supported
    -- storage class or don\'t have a file name extension for a supported file
    -- or storage format.
    MatchingBucket -> Maybe ObjectLevelStatistics
unclassifiableObjectSizeInBytes :: Prelude.Maybe ObjectLevelStatistics
  }
  deriving (MatchingBucket -> MatchingBucket -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MatchingBucket -> MatchingBucket -> Bool
$c/= :: MatchingBucket -> MatchingBucket -> Bool
== :: MatchingBucket -> MatchingBucket -> Bool
$c== :: MatchingBucket -> MatchingBucket -> Bool
Prelude.Eq, ReadPrec [MatchingBucket]
ReadPrec MatchingBucket
Int -> ReadS MatchingBucket
ReadS [MatchingBucket]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MatchingBucket]
$creadListPrec :: ReadPrec [MatchingBucket]
readPrec :: ReadPrec MatchingBucket
$creadPrec :: ReadPrec MatchingBucket
readList :: ReadS [MatchingBucket]
$creadList :: ReadS [MatchingBucket]
readsPrec :: Int -> ReadS MatchingBucket
$creadsPrec :: Int -> ReadS MatchingBucket
Prelude.Read, Int -> MatchingBucket -> ShowS
[MatchingBucket] -> ShowS
MatchingBucket -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MatchingBucket] -> ShowS
$cshowList :: [MatchingBucket] -> ShowS
show :: MatchingBucket -> String
$cshow :: MatchingBucket -> String
showsPrec :: Int -> MatchingBucket -> ShowS
$cshowsPrec :: Int -> MatchingBucket -> ShowS
Prelude.Show, forall x. Rep MatchingBucket x -> MatchingBucket
forall x. MatchingBucket -> Rep MatchingBucket x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MatchingBucket x -> MatchingBucket
$cfrom :: forall x. MatchingBucket -> Rep MatchingBucket x
Prelude.Generic)

-- |
-- Create a value of 'MatchingBucket' 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:
--
-- 'accountId', 'matchingBucket_accountId' - The unique identifier for the Amazon Web Services account that owns the
-- bucket.
--
-- 'bucketName', 'matchingBucket_bucketName' - The name of the bucket.
--
-- 'classifiableObjectCount', 'matchingBucket_classifiableObjectCount' - The total number of objects that Amazon Macie can analyze in the bucket.
-- These objects use a supported storage class and have a file name
-- extension for a supported file or storage format.
--
-- 'classifiableSizeInBytes', 'matchingBucket_classifiableSizeInBytes' - The total storage size, in bytes, of the objects that Amazon Macie can
-- analyze in the bucket. 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 the bucket, Macie calculates this value
-- based on the size of the latest version of each applicable object in the
-- bucket. This value doesn\'t reflect the storage size of all versions of
-- each applicable object in the bucket.
--
-- 'errorCode', 'matchingBucket_errorCode' - Specifies the error code for an error that prevented Amazon Macie from
-- retrieving and processing information about the bucket and the bucket\'s
-- objects. If this value is ACCESS_DENIED, Macie doesn\'t have permission
-- to retrieve the information. For example, the bucket has a restrictive
-- bucket policy and Amazon S3 denied the request. If this value is null,
-- Macie was able to retrieve and process the information.
--
-- 'errorMessage', 'matchingBucket_errorMessage' - A brief description of the error (errorCode) that prevented Amazon Macie
-- from retrieving and processing information about the bucket and the
-- bucket\'s objects. This value is null if Macie was able to retrieve and
-- process the information.
--
-- 'jobDetails', 'matchingBucket_jobDetails' - Specifies whether any one-time or recurring classification jobs are
-- configured to analyze objects in the bucket, and, if so, the details of
-- the job that ran most recently.
--
-- 'lastAutomatedDiscoveryTime', 'matchingBucket_lastAutomatedDiscoveryTime' - The date and time, in UTC and extended ISO 8601 format, when Amazon
-- Macie most recently performed automated sensitive data discovery for the
-- bucket. This value is null if automated sensitive data discovery is
-- currently disabled for your account.
--
-- 'objectCount', 'matchingBucket_objectCount' - The total number of objects in the bucket.
--
-- 'objectCountByEncryptionType', 'matchingBucket_objectCountByEncryptionType' - The total number of objects in the bucket, grouped by server-side
-- encryption type. This includes a grouping that reports the total number
-- of objects that aren\'t encrypted or use client-side encryption.
--
-- 'sensitivityScore', 'matchingBucket_sensitivityScore' - The current sensitivity score for the bucket, ranging from -1 (no
-- analysis due to an error) to 100 (sensitive). This value is null if
-- automated sensitive data discovery is currently disabled for your
-- account.
--
-- 'sizeInBytes', 'matchingBucket_sizeInBytes' - The total storage size, in bytes, of the bucket.
--
-- If versioning is enabled for the bucket, Amazon Macie calculates this
-- value based on the size of the latest version of each object in the
-- bucket. This value doesn\'t reflect the storage size of all versions of
-- each object in the bucket.
--
-- 'sizeInBytesCompressed', 'matchingBucket_sizeInBytesCompressed' - The total storage size, in bytes, of the objects that are compressed
-- (.gz, .gzip, .zip) files in the bucket.
--
-- If versioning is enabled for the bucket, Amazon Macie calculates this
-- value based on the size of the latest version of each applicable object
-- in the bucket. This value doesn\'t reflect the storage size of all
-- versions of each applicable object in the bucket.
--
-- 'unclassifiableObjectCount', 'matchingBucket_unclassifiableObjectCount' - The total number of objects that Amazon Macie can\'t analyze in the
-- bucket. These objects don\'t use a supported storage class or don\'t
-- have a file name extension for a supported file or storage format.
--
-- 'unclassifiableObjectSizeInBytes', 'matchingBucket_unclassifiableObjectSizeInBytes' - The total storage size, in bytes, of the objects that Amazon Macie
-- can\'t analyze in the bucket. These objects don\'t use a supported
-- storage class or don\'t have a file name extension for a supported file
-- or storage format.
newMatchingBucket ::
  MatchingBucket
newMatchingBucket :: MatchingBucket
newMatchingBucket =
  MatchingBucket'
    { $sel:accountId:MatchingBucket' :: Maybe Text
accountId = forall a. Maybe a
Prelude.Nothing,
      $sel:bucketName:MatchingBucket' :: Maybe Text
bucketName = forall a. Maybe a
Prelude.Nothing,
      $sel:classifiableObjectCount:MatchingBucket' :: Maybe Integer
classifiableObjectCount = forall a. Maybe a
Prelude.Nothing,
      $sel:classifiableSizeInBytes:MatchingBucket' :: Maybe Integer
classifiableSizeInBytes = forall a. Maybe a
Prelude.Nothing,
      $sel:errorCode:MatchingBucket' :: Maybe BucketMetadataErrorCode
errorCode = forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:MatchingBucket' :: Maybe Text
errorMessage = forall a. Maybe a
Prelude.Nothing,
      $sel:jobDetails:MatchingBucket' :: Maybe JobDetails
jobDetails = forall a. Maybe a
Prelude.Nothing,
      $sel:lastAutomatedDiscoveryTime:MatchingBucket' :: Maybe ISO8601
lastAutomatedDiscoveryTime = forall a. Maybe a
Prelude.Nothing,
      $sel:objectCount:MatchingBucket' :: Maybe Integer
objectCount = forall a. Maybe a
Prelude.Nothing,
      $sel:objectCountByEncryptionType:MatchingBucket' :: Maybe ObjectCountByEncryptionType
objectCountByEncryptionType = forall a. Maybe a
Prelude.Nothing,
      $sel:sensitivityScore:MatchingBucket' :: Maybe Int
sensitivityScore = forall a. Maybe a
Prelude.Nothing,
      $sel:sizeInBytes:MatchingBucket' :: Maybe Integer
sizeInBytes = forall a. Maybe a
Prelude.Nothing,
      $sel:sizeInBytesCompressed:MatchingBucket' :: Maybe Integer
sizeInBytesCompressed = forall a. Maybe a
Prelude.Nothing,
      $sel:unclassifiableObjectCount:MatchingBucket' :: Maybe ObjectLevelStatistics
unclassifiableObjectCount = forall a. Maybe a
Prelude.Nothing,
      $sel:unclassifiableObjectSizeInBytes:MatchingBucket' :: Maybe ObjectLevelStatistics
unclassifiableObjectSizeInBytes = forall a. Maybe a
Prelude.Nothing
    }

-- | The unique identifier for the Amazon Web Services account that owns the
-- bucket.
matchingBucket_accountId :: Lens.Lens' MatchingBucket (Prelude.Maybe Prelude.Text)
matchingBucket_accountId :: Lens' MatchingBucket (Maybe Text)
matchingBucket_accountId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingBucket' {Maybe Text
accountId :: Maybe Text
$sel:accountId:MatchingBucket' :: MatchingBucket -> Maybe Text
accountId} -> Maybe Text
accountId) (\s :: MatchingBucket
s@MatchingBucket' {} Maybe Text
a -> MatchingBucket
s {$sel:accountId:MatchingBucket' :: Maybe Text
accountId = Maybe Text
a} :: MatchingBucket)

-- | The name of the bucket.
matchingBucket_bucketName :: Lens.Lens' MatchingBucket (Prelude.Maybe Prelude.Text)
matchingBucket_bucketName :: Lens' MatchingBucket (Maybe Text)
matchingBucket_bucketName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingBucket' {Maybe Text
bucketName :: Maybe Text
$sel:bucketName:MatchingBucket' :: MatchingBucket -> Maybe Text
bucketName} -> Maybe Text
bucketName) (\s :: MatchingBucket
s@MatchingBucket' {} Maybe Text
a -> MatchingBucket
s {$sel:bucketName:MatchingBucket' :: Maybe Text
bucketName = Maybe Text
a} :: MatchingBucket)

-- | The total number of objects that Amazon Macie can analyze in the bucket.
-- These objects use a supported storage class and have a file name
-- extension for a supported file or storage format.
matchingBucket_classifiableObjectCount :: Lens.Lens' MatchingBucket (Prelude.Maybe Prelude.Integer)
matchingBucket_classifiableObjectCount :: Lens' MatchingBucket (Maybe Integer)
matchingBucket_classifiableObjectCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingBucket' {Maybe Integer
classifiableObjectCount :: Maybe Integer
$sel:classifiableObjectCount:MatchingBucket' :: MatchingBucket -> Maybe Integer
classifiableObjectCount} -> Maybe Integer
classifiableObjectCount) (\s :: MatchingBucket
s@MatchingBucket' {} Maybe Integer
a -> MatchingBucket
s {$sel:classifiableObjectCount:MatchingBucket' :: Maybe Integer
classifiableObjectCount = Maybe Integer
a} :: MatchingBucket)

-- | The total storage size, in bytes, of the objects that Amazon Macie can
-- analyze in the bucket. 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 the bucket, Macie calculates this value
-- based on the size of the latest version of each applicable object in the
-- bucket. This value doesn\'t reflect the storage size of all versions of
-- each applicable object in the bucket.
matchingBucket_classifiableSizeInBytes :: Lens.Lens' MatchingBucket (Prelude.Maybe Prelude.Integer)
matchingBucket_classifiableSizeInBytes :: Lens' MatchingBucket (Maybe Integer)
matchingBucket_classifiableSizeInBytes = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingBucket' {Maybe Integer
classifiableSizeInBytes :: Maybe Integer
$sel:classifiableSizeInBytes:MatchingBucket' :: MatchingBucket -> Maybe Integer
classifiableSizeInBytes} -> Maybe Integer
classifiableSizeInBytes) (\s :: MatchingBucket
s@MatchingBucket' {} Maybe Integer
a -> MatchingBucket
s {$sel:classifiableSizeInBytes:MatchingBucket' :: Maybe Integer
classifiableSizeInBytes = Maybe Integer
a} :: MatchingBucket)

-- | Specifies the error code for an error that prevented Amazon Macie from
-- retrieving and processing information about the bucket and the bucket\'s
-- objects. If this value is ACCESS_DENIED, Macie doesn\'t have permission
-- to retrieve the information. For example, the bucket has a restrictive
-- bucket policy and Amazon S3 denied the request. If this value is null,
-- Macie was able to retrieve and process the information.
matchingBucket_errorCode :: Lens.Lens' MatchingBucket (Prelude.Maybe BucketMetadataErrorCode)
matchingBucket_errorCode :: Lens' MatchingBucket (Maybe BucketMetadataErrorCode)
matchingBucket_errorCode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingBucket' {Maybe BucketMetadataErrorCode
errorCode :: Maybe BucketMetadataErrorCode
$sel:errorCode:MatchingBucket' :: MatchingBucket -> Maybe BucketMetadataErrorCode
errorCode} -> Maybe BucketMetadataErrorCode
errorCode) (\s :: MatchingBucket
s@MatchingBucket' {} Maybe BucketMetadataErrorCode
a -> MatchingBucket
s {$sel:errorCode:MatchingBucket' :: Maybe BucketMetadataErrorCode
errorCode = Maybe BucketMetadataErrorCode
a} :: MatchingBucket)

-- | A brief description of the error (errorCode) that prevented Amazon Macie
-- from retrieving and processing information about the bucket and the
-- bucket\'s objects. This value is null if Macie was able to retrieve and
-- process the information.
matchingBucket_errorMessage :: Lens.Lens' MatchingBucket (Prelude.Maybe Prelude.Text)
matchingBucket_errorMessage :: Lens' MatchingBucket (Maybe Text)
matchingBucket_errorMessage = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingBucket' {Maybe Text
errorMessage :: Maybe Text
$sel:errorMessage:MatchingBucket' :: MatchingBucket -> Maybe Text
errorMessage} -> Maybe Text
errorMessage) (\s :: MatchingBucket
s@MatchingBucket' {} Maybe Text
a -> MatchingBucket
s {$sel:errorMessage:MatchingBucket' :: Maybe Text
errorMessage = Maybe Text
a} :: MatchingBucket)

-- | Specifies whether any one-time or recurring classification jobs are
-- configured to analyze objects in the bucket, and, if so, the details of
-- the job that ran most recently.
matchingBucket_jobDetails :: Lens.Lens' MatchingBucket (Prelude.Maybe JobDetails)
matchingBucket_jobDetails :: Lens' MatchingBucket (Maybe JobDetails)
matchingBucket_jobDetails = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingBucket' {Maybe JobDetails
jobDetails :: Maybe JobDetails
$sel:jobDetails:MatchingBucket' :: MatchingBucket -> Maybe JobDetails
jobDetails} -> Maybe JobDetails
jobDetails) (\s :: MatchingBucket
s@MatchingBucket' {} Maybe JobDetails
a -> MatchingBucket
s {$sel:jobDetails:MatchingBucket' :: Maybe JobDetails
jobDetails = Maybe JobDetails
a} :: MatchingBucket)

-- | The date and time, in UTC and extended ISO 8601 format, when Amazon
-- Macie most recently performed automated sensitive data discovery for the
-- bucket. This value is null if automated sensitive data discovery is
-- currently disabled for your account.
matchingBucket_lastAutomatedDiscoveryTime :: Lens.Lens' MatchingBucket (Prelude.Maybe Prelude.UTCTime)
matchingBucket_lastAutomatedDiscoveryTime :: Lens' MatchingBucket (Maybe UTCTime)
matchingBucket_lastAutomatedDiscoveryTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingBucket' {Maybe ISO8601
lastAutomatedDiscoveryTime :: Maybe ISO8601
$sel:lastAutomatedDiscoveryTime:MatchingBucket' :: MatchingBucket -> Maybe ISO8601
lastAutomatedDiscoveryTime} -> Maybe ISO8601
lastAutomatedDiscoveryTime) (\s :: MatchingBucket
s@MatchingBucket' {} Maybe ISO8601
a -> MatchingBucket
s {$sel:lastAutomatedDiscoveryTime:MatchingBucket' :: Maybe ISO8601
lastAutomatedDiscoveryTime = Maybe ISO8601
a} :: MatchingBucket) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The total number of objects in the bucket.
matchingBucket_objectCount :: Lens.Lens' MatchingBucket (Prelude.Maybe Prelude.Integer)
matchingBucket_objectCount :: Lens' MatchingBucket (Maybe Integer)
matchingBucket_objectCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingBucket' {Maybe Integer
objectCount :: Maybe Integer
$sel:objectCount:MatchingBucket' :: MatchingBucket -> Maybe Integer
objectCount} -> Maybe Integer
objectCount) (\s :: MatchingBucket
s@MatchingBucket' {} Maybe Integer
a -> MatchingBucket
s {$sel:objectCount:MatchingBucket' :: Maybe Integer
objectCount = Maybe Integer
a} :: MatchingBucket)

-- | The total number of objects in the bucket, grouped by server-side
-- encryption type. This includes a grouping that reports the total number
-- of objects that aren\'t encrypted or use client-side encryption.
matchingBucket_objectCountByEncryptionType :: Lens.Lens' MatchingBucket (Prelude.Maybe ObjectCountByEncryptionType)
matchingBucket_objectCountByEncryptionType :: Lens' MatchingBucket (Maybe ObjectCountByEncryptionType)
matchingBucket_objectCountByEncryptionType = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingBucket' {Maybe ObjectCountByEncryptionType
objectCountByEncryptionType :: Maybe ObjectCountByEncryptionType
$sel:objectCountByEncryptionType:MatchingBucket' :: MatchingBucket -> Maybe ObjectCountByEncryptionType
objectCountByEncryptionType} -> Maybe ObjectCountByEncryptionType
objectCountByEncryptionType) (\s :: MatchingBucket
s@MatchingBucket' {} Maybe ObjectCountByEncryptionType
a -> MatchingBucket
s {$sel:objectCountByEncryptionType:MatchingBucket' :: Maybe ObjectCountByEncryptionType
objectCountByEncryptionType = Maybe ObjectCountByEncryptionType
a} :: MatchingBucket)

-- | The current sensitivity score for the bucket, ranging from -1 (no
-- analysis due to an error) to 100 (sensitive). This value is null if
-- automated sensitive data discovery is currently disabled for your
-- account.
matchingBucket_sensitivityScore :: Lens.Lens' MatchingBucket (Prelude.Maybe Prelude.Int)
matchingBucket_sensitivityScore :: Lens' MatchingBucket (Maybe Int)
matchingBucket_sensitivityScore = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingBucket' {Maybe Int
sensitivityScore :: Maybe Int
$sel:sensitivityScore:MatchingBucket' :: MatchingBucket -> Maybe Int
sensitivityScore} -> Maybe Int
sensitivityScore) (\s :: MatchingBucket
s@MatchingBucket' {} Maybe Int
a -> MatchingBucket
s {$sel:sensitivityScore:MatchingBucket' :: Maybe Int
sensitivityScore = Maybe Int
a} :: MatchingBucket)

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

-- | The total storage size, in bytes, of the objects that are compressed
-- (.gz, .gzip, .zip) files in the bucket.
--
-- If versioning is enabled for the bucket, Amazon Macie calculates this
-- value based on the size of the latest version of each applicable object
-- in the bucket. This value doesn\'t reflect the storage size of all
-- versions of each applicable object in the bucket.
matchingBucket_sizeInBytesCompressed :: Lens.Lens' MatchingBucket (Prelude.Maybe Prelude.Integer)
matchingBucket_sizeInBytesCompressed :: Lens' MatchingBucket (Maybe Integer)
matchingBucket_sizeInBytesCompressed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MatchingBucket' {Maybe Integer
sizeInBytesCompressed :: Maybe Integer
$sel:sizeInBytesCompressed:MatchingBucket' :: MatchingBucket -> Maybe Integer
sizeInBytesCompressed} -> Maybe Integer
sizeInBytesCompressed) (\s :: MatchingBucket
s@MatchingBucket' {} Maybe Integer
a -> MatchingBucket
s {$sel:sizeInBytesCompressed:MatchingBucket' :: Maybe Integer
sizeInBytesCompressed = Maybe Integer
a} :: MatchingBucket)

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

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

instance Data.FromJSON MatchingBucket where
  parseJSON :: Value -> Parser MatchingBucket
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MatchingBucket"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> Maybe BucketMetadataErrorCode
-> Maybe Text
-> Maybe JobDetails
-> Maybe ISO8601
-> Maybe Integer
-> Maybe ObjectCountByEncryptionType
-> Maybe Int
-> Maybe Integer
-> Maybe Integer
-> Maybe ObjectLevelStatistics
-> Maybe ObjectLevelStatistics
-> MatchingBucket
MatchingBucket'
            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
"accountId")
            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
"bucketName")
            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
"classifiableObjectCount")
            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
"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
"errorCode")
            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
"errorMessage")
            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
"jobDetails")
            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
"lastAutomatedDiscoveryTime")
            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
"objectCount")
            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
"objectCountByEncryptionType")
            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
"sensitivityScore")
            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
"sizeInBytes")
            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
"sizeInBytesCompressed")
            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
"unclassifiableObjectCount")
            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
"unclassifiableObjectSizeInBytes")
      )

instance Prelude.Hashable MatchingBucket where
  hashWithSalt :: Int -> MatchingBucket -> Int
hashWithSalt Int
_salt MatchingBucket' {Maybe Int
Maybe Integer
Maybe Text
Maybe ISO8601
Maybe BucketMetadataErrorCode
Maybe JobDetails
Maybe ObjectCountByEncryptionType
Maybe ObjectLevelStatistics
unclassifiableObjectSizeInBytes :: Maybe ObjectLevelStatistics
unclassifiableObjectCount :: Maybe ObjectLevelStatistics
sizeInBytesCompressed :: Maybe Integer
sizeInBytes :: Maybe Integer
sensitivityScore :: Maybe Int
objectCountByEncryptionType :: Maybe ObjectCountByEncryptionType
objectCount :: Maybe Integer
lastAutomatedDiscoveryTime :: Maybe ISO8601
jobDetails :: Maybe JobDetails
errorMessage :: Maybe Text
errorCode :: Maybe BucketMetadataErrorCode
classifiableSizeInBytes :: Maybe Integer
classifiableObjectCount :: Maybe Integer
bucketName :: Maybe Text
accountId :: Maybe Text
$sel:unclassifiableObjectSizeInBytes:MatchingBucket' :: MatchingBucket -> Maybe ObjectLevelStatistics
$sel:unclassifiableObjectCount:MatchingBucket' :: MatchingBucket -> Maybe ObjectLevelStatistics
$sel:sizeInBytesCompressed:MatchingBucket' :: MatchingBucket -> Maybe Integer
$sel:sizeInBytes:MatchingBucket' :: MatchingBucket -> Maybe Integer
$sel:sensitivityScore:MatchingBucket' :: MatchingBucket -> Maybe Int
$sel:objectCountByEncryptionType:MatchingBucket' :: MatchingBucket -> Maybe ObjectCountByEncryptionType
$sel:objectCount:MatchingBucket' :: MatchingBucket -> Maybe Integer
$sel:lastAutomatedDiscoveryTime:MatchingBucket' :: MatchingBucket -> Maybe ISO8601
$sel:jobDetails:MatchingBucket' :: MatchingBucket -> Maybe JobDetails
$sel:errorMessage:MatchingBucket' :: MatchingBucket -> Maybe Text
$sel:errorCode:MatchingBucket' :: MatchingBucket -> Maybe BucketMetadataErrorCode
$sel:classifiableSizeInBytes:MatchingBucket' :: MatchingBucket -> Maybe Integer
$sel:classifiableObjectCount:MatchingBucket' :: MatchingBucket -> Maybe Integer
$sel:bucketName:MatchingBucket' :: MatchingBucket -> Maybe Text
$sel:accountId:MatchingBucket' :: MatchingBucket -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
accountId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
bucketName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
classifiableObjectCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
classifiableSizeInBytes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BucketMetadataErrorCode
errorCode
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
errorMessage
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe JobDetails
jobDetails
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ISO8601
lastAutomatedDiscoveryTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
objectCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ObjectCountByEncryptionType
objectCountByEncryptionType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
sensitivityScore
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
sizeInBytes
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
sizeInBytesCompressed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ObjectLevelStatistics
unclassifiableObjectCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ObjectLevelStatistics
unclassifiableObjectSizeInBytes

instance Prelude.NFData MatchingBucket where
  rnf :: MatchingBucket -> ()
rnf MatchingBucket' {Maybe Int
Maybe Integer
Maybe Text
Maybe ISO8601
Maybe BucketMetadataErrorCode
Maybe JobDetails
Maybe ObjectCountByEncryptionType
Maybe ObjectLevelStatistics
unclassifiableObjectSizeInBytes :: Maybe ObjectLevelStatistics
unclassifiableObjectCount :: Maybe ObjectLevelStatistics
sizeInBytesCompressed :: Maybe Integer
sizeInBytes :: Maybe Integer
sensitivityScore :: Maybe Int
objectCountByEncryptionType :: Maybe ObjectCountByEncryptionType
objectCount :: Maybe Integer
lastAutomatedDiscoveryTime :: Maybe ISO8601
jobDetails :: Maybe JobDetails
errorMessage :: Maybe Text
errorCode :: Maybe BucketMetadataErrorCode
classifiableSizeInBytes :: Maybe Integer
classifiableObjectCount :: Maybe Integer
bucketName :: Maybe Text
accountId :: Maybe Text
$sel:unclassifiableObjectSizeInBytes:MatchingBucket' :: MatchingBucket -> Maybe ObjectLevelStatistics
$sel:unclassifiableObjectCount:MatchingBucket' :: MatchingBucket -> Maybe ObjectLevelStatistics
$sel:sizeInBytesCompressed:MatchingBucket' :: MatchingBucket -> Maybe Integer
$sel:sizeInBytes:MatchingBucket' :: MatchingBucket -> Maybe Integer
$sel:sensitivityScore:MatchingBucket' :: MatchingBucket -> Maybe Int
$sel:objectCountByEncryptionType:MatchingBucket' :: MatchingBucket -> Maybe ObjectCountByEncryptionType
$sel:objectCount:MatchingBucket' :: MatchingBucket -> Maybe Integer
$sel:lastAutomatedDiscoveryTime:MatchingBucket' :: MatchingBucket -> Maybe ISO8601
$sel:jobDetails:MatchingBucket' :: MatchingBucket -> Maybe JobDetails
$sel:errorMessage:MatchingBucket' :: MatchingBucket -> Maybe Text
$sel:errorCode:MatchingBucket' :: MatchingBucket -> Maybe BucketMetadataErrorCode
$sel:classifiableSizeInBytes:MatchingBucket' :: MatchingBucket -> Maybe Integer
$sel:classifiableObjectCount:MatchingBucket' :: MatchingBucket -> Maybe Integer
$sel:bucketName:MatchingBucket' :: MatchingBucket -> Maybe Text
$sel:accountId:MatchingBucket' :: MatchingBucket -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
accountId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
bucketName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
classifiableObjectCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 BucketMetadataErrorCode
errorCode
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
errorMessage
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe JobDetails
jobDetails
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ISO8601
lastAutomatedDiscoveryTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
objectCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ObjectCountByEncryptionType
objectCountByEncryptionType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
sensitivityScore
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
sizeInBytes
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
sizeInBytesCompressed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ObjectLevelStatistics
unclassifiableObjectCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf
        Maybe ObjectLevelStatistics
unclassifiableObjectSizeInBytes