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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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. 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 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 are 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 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 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 unique identifier for the Amazon Web Services account that owns the
    -- bucket.
    MatchingBucket -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text,
    -- | 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,
    -- | 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,
    -- | 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,
    -- | 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,
    -- | 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,
    -- | The total number of objects in the bucket.
    MatchingBucket -> Maybe Integer
objectCount :: 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
  }
  deriving (MatchingBucket -> MatchingBucket -> Bool
(MatchingBucket -> MatchingBucket -> Bool)
-> (MatchingBucket -> MatchingBucket -> Bool) -> Eq MatchingBucket
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]
(Int -> ReadS MatchingBucket)
-> ReadS [MatchingBucket]
-> ReadPrec MatchingBucket
-> ReadPrec [MatchingBucket]
-> Read 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
(Int -> MatchingBucket -> ShowS)
-> (MatchingBucket -> String)
-> ([MatchingBucket] -> ShowS)
-> Show MatchingBucket
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. MatchingBucket -> Rep MatchingBucket x)
-> (forall x. Rep MatchingBucket x -> MatchingBucket)
-> Generic MatchingBucket
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:
--
-- '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.
--
-- 'objectCountByEncryptionType', 'matchingBucket_objectCountByEncryptionType' - The total number of objects that are 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.
--
-- '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.
--
-- '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.
--
-- 'accountId', 'matchingBucket_accountId' - The unique identifier for the Amazon Web Services account that owns the
-- bucket.
--
-- '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.
--
-- '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.
--
-- '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.
--
-- '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.
--
-- '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.
--
-- 'objectCount', 'matchingBucket_objectCount' - The total number of objects in the bucket.
--
-- '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.
newMatchingBucket ::
  MatchingBucket
newMatchingBucket :: MatchingBucket
newMatchingBucket =
  MatchingBucket' :: Maybe Integer
-> Maybe ObjectCountByEncryptionType
-> Maybe Integer
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe ObjectLevelStatistics
-> Maybe ObjectLevelStatistics
-> Maybe BucketMetadataErrorCode
-> Maybe JobDetails
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> MatchingBucket
MatchingBucket'
    { $sel:sizeInBytesCompressed:MatchingBucket' :: Maybe Integer
sizeInBytesCompressed =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:objectCountByEncryptionType:MatchingBucket' :: Maybe ObjectCountByEncryptionType
objectCountByEncryptionType = Maybe ObjectCountByEncryptionType
forall a. Maybe a
Prelude.Nothing,
      $sel:sizeInBytes:MatchingBucket' :: Maybe Integer
sizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketName:MatchingBucket' :: Maybe Text
bucketName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:classifiableObjectCount:MatchingBucket' :: Maybe Integer
classifiableObjectCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:accountId:MatchingBucket' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:unclassifiableObjectSizeInBytes:MatchingBucket' :: Maybe ObjectLevelStatistics
unclassifiableObjectSizeInBytes = Maybe ObjectLevelStatistics
forall a. Maybe a
Prelude.Nothing,
      $sel:unclassifiableObjectCount:MatchingBucket' :: Maybe ObjectLevelStatistics
unclassifiableObjectCount = Maybe ObjectLevelStatistics
forall a. Maybe a
Prelude.Nothing,
      $sel:errorCode:MatchingBucket' :: Maybe BucketMetadataErrorCode
errorCode = Maybe BucketMetadataErrorCode
forall a. Maybe a
Prelude.Nothing,
      $sel:jobDetails:MatchingBucket' :: Maybe JobDetails
jobDetails = Maybe JobDetails
forall a. Maybe a
Prelude.Nothing,
      $sel:errorMessage:MatchingBucket' :: Maybe Text
errorMessage = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:objectCount:MatchingBucket' :: Maybe Integer
objectCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:classifiableSizeInBytes:MatchingBucket' :: Maybe Integer
classifiableSizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Integer -> f (Maybe Integer))
-> MatchingBucket -> f MatchingBucket
matchingBucket_sizeInBytesCompressed = (MatchingBucket -> Maybe Integer)
-> (MatchingBucket -> Maybe Integer -> MatchingBucket)
-> Lens
     MatchingBucket MatchingBucket (Maybe Integer) (Maybe Integer)
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 are 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 :: (Maybe ObjectCountByEncryptionType
 -> f (Maybe ObjectCountByEncryptionType))
-> MatchingBucket -> f MatchingBucket
matchingBucket_objectCountByEncryptionType = (MatchingBucket -> Maybe ObjectCountByEncryptionType)
-> (MatchingBucket
    -> Maybe ObjectCountByEncryptionType -> MatchingBucket)
-> Lens
     MatchingBucket
     MatchingBucket
     (Maybe ObjectCountByEncryptionType)
     (Maybe 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 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 :: (Maybe Integer -> f (Maybe Integer))
-> MatchingBucket -> f MatchingBucket
matchingBucket_sizeInBytes = (MatchingBucket -> Maybe Integer)
-> (MatchingBucket -> Maybe Integer -> MatchingBucket)
-> Lens
     MatchingBucket MatchingBucket (Maybe Integer) (Maybe Integer)
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 name of the bucket.
matchingBucket_bucketName :: Lens.Lens' MatchingBucket (Prelude.Maybe Prelude.Text)
matchingBucket_bucketName :: (Maybe Text -> f (Maybe Text))
-> MatchingBucket -> f MatchingBucket
matchingBucket_bucketName = (MatchingBucket -> Maybe Text)
-> (MatchingBucket -> Maybe Text -> MatchingBucket)
-> Lens MatchingBucket MatchingBucket (Maybe Text) (Maybe Text)
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 :: (Maybe Integer -> f (Maybe Integer))
-> MatchingBucket -> f MatchingBucket
matchingBucket_classifiableObjectCount = (MatchingBucket -> Maybe Integer)
-> (MatchingBucket -> Maybe Integer -> MatchingBucket)
-> Lens
     MatchingBucket MatchingBucket (Maybe Integer) (Maybe Integer)
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 unique identifier for the Amazon Web Services account that owns the
-- bucket.
matchingBucket_accountId :: Lens.Lens' MatchingBucket (Prelude.Maybe Prelude.Text)
matchingBucket_accountId :: (Maybe Text -> f (Maybe Text))
-> MatchingBucket -> f MatchingBucket
matchingBucket_accountId = (MatchingBucket -> Maybe Text)
-> (MatchingBucket -> Maybe Text -> MatchingBucket)
-> Lens MatchingBucket MatchingBucket (Maybe Text) (Maybe Text)
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 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 :: (Maybe ObjectLevelStatistics -> f (Maybe ObjectLevelStatistics))
-> MatchingBucket -> f MatchingBucket
matchingBucket_unclassifiableObjectSizeInBytes = (MatchingBucket -> Maybe ObjectLevelStatistics)
-> (MatchingBucket
    -> Maybe ObjectLevelStatistics -> MatchingBucket)
-> Lens
     MatchingBucket
     MatchingBucket
     (Maybe ObjectLevelStatistics)
     (Maybe ObjectLevelStatistics)
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)

-- | 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 :: (Maybe ObjectLevelStatistics -> f (Maybe ObjectLevelStatistics))
-> MatchingBucket -> f MatchingBucket
matchingBucket_unclassifiableObjectCount = (MatchingBucket -> Maybe ObjectLevelStatistics)
-> (MatchingBucket
    -> Maybe ObjectLevelStatistics -> MatchingBucket)
-> Lens
     MatchingBucket
     MatchingBucket
     (Maybe ObjectLevelStatistics)
     (Maybe ObjectLevelStatistics)
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)

-- | 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 :: (Maybe BucketMetadataErrorCode
 -> f (Maybe BucketMetadataErrorCode))
-> MatchingBucket -> f MatchingBucket
matchingBucket_errorCode = (MatchingBucket -> Maybe BucketMetadataErrorCode)
-> (MatchingBucket
    -> Maybe BucketMetadataErrorCode -> MatchingBucket)
-> Lens
     MatchingBucket
     MatchingBucket
     (Maybe BucketMetadataErrorCode)
     (Maybe BucketMetadataErrorCode)
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)

-- | 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 :: (Maybe JobDetails -> f (Maybe JobDetails))
-> MatchingBucket -> f MatchingBucket
matchingBucket_jobDetails = (MatchingBucket -> Maybe JobDetails)
-> (MatchingBucket -> Maybe JobDetails -> MatchingBucket)
-> Lens
     MatchingBucket MatchingBucket (Maybe JobDetails) (Maybe 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)

-- | 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 :: (Maybe Text -> f (Maybe Text))
-> MatchingBucket -> f MatchingBucket
matchingBucket_errorMessage = (MatchingBucket -> Maybe Text)
-> (MatchingBucket -> Maybe Text -> MatchingBucket)
-> Lens MatchingBucket MatchingBucket (Maybe Text) (Maybe Text)
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)

-- | The total number of objects in the bucket.
matchingBucket_objectCount :: Lens.Lens' MatchingBucket (Prelude.Maybe Prelude.Integer)
matchingBucket_objectCount :: (Maybe Integer -> f (Maybe Integer))
-> MatchingBucket -> f MatchingBucket
matchingBucket_objectCount = (MatchingBucket -> Maybe Integer)
-> (MatchingBucket -> Maybe Integer -> MatchingBucket)
-> Lens
     MatchingBucket MatchingBucket (Maybe Integer) (Maybe Integer)
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 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 :: (Maybe Integer -> f (Maybe Integer))
-> MatchingBucket -> f MatchingBucket
matchingBucket_classifiableSizeInBytes = (MatchingBucket -> Maybe Integer)
-> (MatchingBucket -> Maybe Integer -> MatchingBucket)
-> Lens
     MatchingBucket MatchingBucket (Maybe Integer) (Maybe Integer)
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)

instance Core.FromJSON MatchingBucket where
  parseJSON :: Value -> Parser MatchingBucket
parseJSON =
    String
-> (Object -> Parser MatchingBucket)
-> Value
-> Parser MatchingBucket
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MatchingBucket"
      ( \Object
x ->
          Maybe Integer
-> Maybe ObjectCountByEncryptionType
-> Maybe Integer
-> Maybe Text
-> Maybe Integer
-> Maybe Text
-> Maybe ObjectLevelStatistics
-> Maybe ObjectLevelStatistics
-> Maybe BucketMetadataErrorCode
-> Maybe JobDetails
-> Maybe Text
-> Maybe Integer
-> Maybe Integer
-> MatchingBucket
MatchingBucket'
            (Maybe Integer
 -> Maybe ObjectCountByEncryptionType
 -> Maybe Integer
 -> Maybe Text
 -> Maybe Integer
 -> Maybe Text
 -> Maybe ObjectLevelStatistics
 -> Maybe ObjectLevelStatistics
 -> Maybe BucketMetadataErrorCode
 -> Maybe JobDetails
 -> Maybe Text
 -> Maybe Integer
 -> Maybe Integer
 -> MatchingBucket)
-> Parser (Maybe Integer)
-> Parser
     (Maybe ObjectCountByEncryptionType
      -> Maybe Integer
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Text
      -> Maybe ObjectLevelStatistics
      -> Maybe ObjectLevelStatistics
      -> Maybe BucketMetadataErrorCode
      -> Maybe JobDetails
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Integer
      -> MatchingBucket)
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
"sizeInBytesCompressed")
            Parser
  (Maybe ObjectCountByEncryptionType
   -> Maybe Integer
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Text
   -> Maybe ObjectLevelStatistics
   -> Maybe ObjectLevelStatistics
   -> Maybe BucketMetadataErrorCode
   -> Maybe JobDetails
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Integer
   -> MatchingBucket)
-> Parser (Maybe ObjectCountByEncryptionType)
-> Parser
     (Maybe Integer
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Text
      -> Maybe ObjectLevelStatistics
      -> Maybe ObjectLevelStatistics
      -> Maybe BucketMetadataErrorCode
      -> Maybe JobDetails
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Integer
      -> MatchingBucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ObjectCountByEncryptionType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"objectCountByEncryptionType")
            Parser
  (Maybe Integer
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Text
   -> Maybe ObjectLevelStatistics
   -> Maybe ObjectLevelStatistics
   -> Maybe BucketMetadataErrorCode
   -> Maybe JobDetails
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Integer
   -> MatchingBucket)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe Integer
      -> Maybe Text
      -> Maybe ObjectLevelStatistics
      -> Maybe ObjectLevelStatistics
      -> Maybe BucketMetadataErrorCode
      -> Maybe JobDetails
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Integer
      -> MatchingBucket)
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
"sizeInBytes")
            Parser
  (Maybe Text
   -> Maybe Integer
   -> Maybe Text
   -> Maybe ObjectLevelStatistics
   -> Maybe ObjectLevelStatistics
   -> Maybe BucketMetadataErrorCode
   -> Maybe JobDetails
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Integer
   -> MatchingBucket)
-> Parser (Maybe Text)
-> Parser
     (Maybe Integer
      -> Maybe Text
      -> Maybe ObjectLevelStatistics
      -> Maybe ObjectLevelStatistics
      -> Maybe BucketMetadataErrorCode
      -> Maybe JobDetails
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Integer
      -> MatchingBucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bucketName")
            Parser
  (Maybe Integer
   -> Maybe Text
   -> Maybe ObjectLevelStatistics
   -> Maybe ObjectLevelStatistics
   -> Maybe BucketMetadataErrorCode
   -> Maybe JobDetails
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Integer
   -> MatchingBucket)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Text
      -> Maybe ObjectLevelStatistics
      -> Maybe ObjectLevelStatistics
      -> Maybe BucketMetadataErrorCode
      -> Maybe JobDetails
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Integer
      -> MatchingBucket)
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
"classifiableObjectCount")
            Parser
  (Maybe Text
   -> Maybe ObjectLevelStatistics
   -> Maybe ObjectLevelStatistics
   -> Maybe BucketMetadataErrorCode
   -> Maybe JobDetails
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Integer
   -> MatchingBucket)
-> Parser (Maybe Text)
-> Parser
     (Maybe ObjectLevelStatistics
      -> Maybe ObjectLevelStatistics
      -> Maybe BucketMetadataErrorCode
      -> Maybe JobDetails
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Integer
      -> MatchingBucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"accountId")
            Parser
  (Maybe ObjectLevelStatistics
   -> Maybe ObjectLevelStatistics
   -> Maybe BucketMetadataErrorCode
   -> Maybe JobDetails
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Integer
   -> MatchingBucket)
-> Parser (Maybe ObjectLevelStatistics)
-> Parser
     (Maybe ObjectLevelStatistics
      -> Maybe BucketMetadataErrorCode
      -> Maybe JobDetails
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Integer
      -> MatchingBucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ObjectLevelStatistics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"unclassifiableObjectSizeInBytes")
            Parser
  (Maybe ObjectLevelStatistics
   -> Maybe BucketMetadataErrorCode
   -> Maybe JobDetails
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Integer
   -> MatchingBucket)
-> Parser (Maybe ObjectLevelStatistics)
-> Parser
     (Maybe BucketMetadataErrorCode
      -> Maybe JobDetails
      -> Maybe Text
      -> Maybe Integer
      -> Maybe Integer
      -> MatchingBucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ObjectLevelStatistics)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"unclassifiableObjectCount")
            Parser
  (Maybe BucketMetadataErrorCode
   -> Maybe JobDetails
   -> Maybe Text
   -> Maybe Integer
   -> Maybe Integer
   -> MatchingBucket)
-> Parser (Maybe BucketMetadataErrorCode)
-> Parser
     (Maybe JobDetails
      -> Maybe Text -> Maybe Integer -> Maybe Integer -> MatchingBucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe BucketMetadataErrorCode)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorCode")
            Parser
  (Maybe JobDetails
   -> Maybe Text -> Maybe Integer -> Maybe Integer -> MatchingBucket)
-> Parser (Maybe JobDetails)
-> Parser
     (Maybe Text -> Maybe Integer -> Maybe Integer -> MatchingBucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe JobDetails)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"jobDetails")
            Parser
  (Maybe Text -> Maybe Integer -> Maybe Integer -> MatchingBucket)
-> Parser (Maybe Text)
-> Parser (Maybe Integer -> Maybe Integer -> MatchingBucket)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"errorMessage")
            Parser (Maybe Integer -> Maybe Integer -> MatchingBucket)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> MatchingBucket)
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
"objectCount")
            Parser (Maybe Integer -> MatchingBucket)
-> Parser (Maybe Integer) -> Parser MatchingBucket
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
"classifiableSizeInBytes")
      )

instance Prelude.Hashable MatchingBucket

instance Prelude.NFData MatchingBucket