{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.GetBucketStatistics
-- 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)
--
-- Retrieves (queries) aggregated statistical data for all the S3 buckets
-- that Amazon Macie monitors and analyzes.
module Amazonka.MacieV2.GetBucketStatistics
  ( -- * Creating a Request
    GetBucketStatistics (..),
    newGetBucketStatistics,

    -- * Request Lenses
    getBucketStatistics_accountId,

    -- * Destructuring the Response
    GetBucketStatisticsResponse (..),
    newGetBucketStatisticsResponse,

    -- * Response Lenses
    getBucketStatisticsResponse_sizeInBytesCompressed,
    getBucketStatisticsResponse_lastUpdated,
    getBucketStatisticsResponse_sizeInBytes,
    getBucketStatisticsResponse_bucketCountBySharedAccessType,
    getBucketStatisticsResponse_classifiableObjectCount,
    getBucketStatisticsResponse_unclassifiableObjectSizeInBytes,
    getBucketStatisticsResponse_unclassifiableObjectCount,
    getBucketStatisticsResponse_bucketCount,
    getBucketStatisticsResponse_bucketCountByEffectivePermission,
    getBucketStatisticsResponse_bucketCountByObjectEncryptionRequirement,
    getBucketStatisticsResponse_objectCount,
    getBucketStatisticsResponse_classifiableSizeInBytes,
    getBucketStatisticsResponse_bucketCountByEncryptionType,
    getBucketStatisticsResponse_httpStatus,
  )
where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MacieV2.Types
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newGetBucketStatistics' smart constructor.
data GetBucketStatistics = GetBucketStatistics'
  { -- | The unique identifier for the Amazon Web Services account.
    GetBucketStatistics -> Maybe Text
accountId :: Prelude.Maybe Prelude.Text
  }
  deriving (GetBucketStatistics -> GetBucketStatistics -> Bool
(GetBucketStatistics -> GetBucketStatistics -> Bool)
-> (GetBucketStatistics -> GetBucketStatistics -> Bool)
-> Eq GetBucketStatistics
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketStatistics -> GetBucketStatistics -> Bool
$c/= :: GetBucketStatistics -> GetBucketStatistics -> Bool
== :: GetBucketStatistics -> GetBucketStatistics -> Bool
$c== :: GetBucketStatistics -> GetBucketStatistics -> Bool
Prelude.Eq, ReadPrec [GetBucketStatistics]
ReadPrec GetBucketStatistics
Int -> ReadS GetBucketStatistics
ReadS [GetBucketStatistics]
(Int -> ReadS GetBucketStatistics)
-> ReadS [GetBucketStatistics]
-> ReadPrec GetBucketStatistics
-> ReadPrec [GetBucketStatistics]
-> Read GetBucketStatistics
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBucketStatistics]
$creadListPrec :: ReadPrec [GetBucketStatistics]
readPrec :: ReadPrec GetBucketStatistics
$creadPrec :: ReadPrec GetBucketStatistics
readList :: ReadS [GetBucketStatistics]
$creadList :: ReadS [GetBucketStatistics]
readsPrec :: Int -> ReadS GetBucketStatistics
$creadsPrec :: Int -> ReadS GetBucketStatistics
Prelude.Read, Int -> GetBucketStatistics -> ShowS
[GetBucketStatistics] -> ShowS
GetBucketStatistics -> String
(Int -> GetBucketStatistics -> ShowS)
-> (GetBucketStatistics -> String)
-> ([GetBucketStatistics] -> ShowS)
-> Show GetBucketStatistics
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketStatistics] -> ShowS
$cshowList :: [GetBucketStatistics] -> ShowS
show :: GetBucketStatistics -> String
$cshow :: GetBucketStatistics -> String
showsPrec :: Int -> GetBucketStatistics -> ShowS
$cshowsPrec :: Int -> GetBucketStatistics -> ShowS
Prelude.Show, (forall x. GetBucketStatistics -> Rep GetBucketStatistics x)
-> (forall x. Rep GetBucketStatistics x -> GetBucketStatistics)
-> Generic GetBucketStatistics
forall x. Rep GetBucketStatistics x -> GetBucketStatistics
forall x. GetBucketStatistics -> Rep GetBucketStatistics x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GetBucketStatistics x -> GetBucketStatistics
$cfrom :: forall x. GetBucketStatistics -> Rep GetBucketStatistics x
Prelude.Generic)

-- |
-- Create a value of 'GetBucketStatistics' 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', 'getBucketStatistics_accountId' - The unique identifier for the Amazon Web Services account.
newGetBucketStatistics ::
  GetBucketStatistics
newGetBucketStatistics :: GetBucketStatistics
newGetBucketStatistics =
  GetBucketStatistics' :: Maybe Text -> GetBucketStatistics
GetBucketStatistics' {$sel:accountId:GetBucketStatistics' :: Maybe Text
accountId = Maybe Text
forall a. Maybe a
Prelude.Nothing}

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

instance Core.AWSRequest GetBucketStatistics where
  type
    AWSResponse GetBucketStatistics =
      GetBucketStatisticsResponse
  request :: GetBucketStatistics -> Request GetBucketStatistics
request = Service -> GetBucketStatistics -> Request GetBucketStatistics
forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON Service
defaultService
  response :: Logger
-> Service
-> Proxy GetBucketStatistics
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetBucketStatistics)))
response =
    (Int
 -> ResponseHeaders
 -> Object
 -> Either String (AWSResponse GetBucketStatistics))
-> Logger
-> Service
-> Proxy GetBucketStatistics
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse GetBucketStatistics)))
forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> Logger
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Integer
-> Maybe POSIX
-> Maybe Integer
-> Maybe BucketCountBySharedAccessType
-> Maybe Integer
-> Maybe ObjectLevelStatistics
-> Maybe ObjectLevelStatistics
-> Maybe Integer
-> Maybe BucketCountByEffectivePermission
-> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
-> Maybe Integer
-> Maybe Integer
-> Maybe BucketCountByEncryptionType
-> Int
-> GetBucketStatisticsResponse
GetBucketStatisticsResponse'
            (Maybe Integer
 -> Maybe POSIX
 -> Maybe Integer
 -> Maybe BucketCountBySharedAccessType
 -> Maybe Integer
 -> Maybe ObjectLevelStatistics
 -> Maybe ObjectLevelStatistics
 -> Maybe Integer
 -> Maybe BucketCountByEffectivePermission
 -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
 -> Maybe Integer
 -> Maybe Integer
 -> Maybe BucketCountByEncryptionType
 -> Int
 -> GetBucketStatisticsResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe POSIX
      -> Maybe Integer
      -> Maybe BucketCountBySharedAccessType
      -> Maybe Integer
      -> Maybe ObjectLevelStatistics
      -> Maybe ObjectLevelStatistics
      -> Maybe Integer
      -> Maybe BucketCountByEffectivePermission
      -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe BucketCountByEncryptionType
      -> Int
      -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"sizeInBytesCompressed")
            Either
  String
  (Maybe POSIX
   -> Maybe Integer
   -> Maybe BucketCountBySharedAccessType
   -> Maybe Integer
   -> Maybe ObjectLevelStatistics
   -> Maybe ObjectLevelStatistics
   -> Maybe Integer
   -> Maybe BucketCountByEffectivePermission
   -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe BucketCountByEncryptionType
   -> Int
   -> GetBucketStatisticsResponse)
-> Either String (Maybe POSIX)
-> Either
     String
     (Maybe Integer
      -> Maybe BucketCountBySharedAccessType
      -> Maybe Integer
      -> Maybe ObjectLevelStatistics
      -> Maybe ObjectLevelStatistics
      -> Maybe Integer
      -> Maybe BucketCountByEffectivePermission
      -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe BucketCountByEncryptionType
      -> Int
      -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"lastUpdated")
            Either
  String
  (Maybe Integer
   -> Maybe BucketCountBySharedAccessType
   -> Maybe Integer
   -> Maybe ObjectLevelStatistics
   -> Maybe ObjectLevelStatistics
   -> Maybe Integer
   -> Maybe BucketCountByEffectivePermission
   -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe BucketCountByEncryptionType
   -> Int
   -> GetBucketStatisticsResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe BucketCountBySharedAccessType
      -> Maybe Integer
      -> Maybe ObjectLevelStatistics
      -> Maybe ObjectLevelStatistics
      -> Maybe Integer
      -> Maybe BucketCountByEffectivePermission
      -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe BucketCountByEncryptionType
      -> Int
      -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"sizeInBytes")
            Either
  String
  (Maybe BucketCountBySharedAccessType
   -> Maybe Integer
   -> Maybe ObjectLevelStatistics
   -> Maybe ObjectLevelStatistics
   -> Maybe Integer
   -> Maybe BucketCountByEffectivePermission
   -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe BucketCountByEncryptionType
   -> Int
   -> GetBucketStatisticsResponse)
-> Either String (Maybe BucketCountBySharedAccessType)
-> Either
     String
     (Maybe Integer
      -> Maybe ObjectLevelStatistics
      -> Maybe ObjectLevelStatistics
      -> Maybe Integer
      -> Maybe BucketCountByEffectivePermission
      -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe BucketCountByEncryptionType
      -> Int
      -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe BucketCountBySharedAccessType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"bucketCountBySharedAccessType")
            Either
  String
  (Maybe Integer
   -> Maybe ObjectLevelStatistics
   -> Maybe ObjectLevelStatistics
   -> Maybe Integer
   -> Maybe BucketCountByEffectivePermission
   -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe BucketCountByEncryptionType
   -> Int
   -> GetBucketStatisticsResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe ObjectLevelStatistics
      -> Maybe ObjectLevelStatistics
      -> Maybe Integer
      -> Maybe BucketCountByEffectivePermission
      -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe BucketCountByEncryptionType
      -> Int
      -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"classifiableObjectCount")
            Either
  String
  (Maybe ObjectLevelStatistics
   -> Maybe ObjectLevelStatistics
   -> Maybe Integer
   -> Maybe BucketCountByEffectivePermission
   -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe BucketCountByEncryptionType
   -> Int
   -> GetBucketStatisticsResponse)
-> Either String (Maybe ObjectLevelStatistics)
-> Either
     String
     (Maybe ObjectLevelStatistics
      -> Maybe Integer
      -> Maybe BucketCountByEffectivePermission
      -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe BucketCountByEncryptionType
      -> Int
      -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ObjectLevelStatistics)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"unclassifiableObjectSizeInBytes")
            Either
  String
  (Maybe ObjectLevelStatistics
   -> Maybe Integer
   -> Maybe BucketCountByEffectivePermission
   -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe BucketCountByEncryptionType
   -> Int
   -> GetBucketStatisticsResponse)
-> Either String (Maybe ObjectLevelStatistics)
-> Either
     String
     (Maybe Integer
      -> Maybe BucketCountByEffectivePermission
      -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe BucketCountByEncryptionType
      -> Int
      -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe ObjectLevelStatistics)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"unclassifiableObjectCount")
            Either
  String
  (Maybe Integer
   -> Maybe BucketCountByEffectivePermission
   -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe BucketCountByEncryptionType
   -> Int
   -> GetBucketStatisticsResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe BucketCountByEffectivePermission
      -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe BucketCountByEncryptionType
      -> Int
      -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"bucketCount")
            Either
  String
  (Maybe BucketCountByEffectivePermission
   -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe BucketCountByEncryptionType
   -> Int
   -> GetBucketStatisticsResponse)
-> Either String (Maybe BucketCountByEffectivePermission)
-> Either
     String
     (Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
      -> Maybe Integer
      -> Maybe Integer
      -> Maybe BucketCountByEncryptionType
      -> Int
      -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object
-> Text -> Either String (Maybe BucketCountByEffectivePermission)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"bucketCountByEffectivePermission")
            Either
  String
  (Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
   -> Maybe Integer
   -> Maybe Integer
   -> Maybe BucketCountByEncryptionType
   -> Int
   -> GetBucketStatisticsResponse)
-> Either
     String (Maybe BucketCountPolicyAllowsUnencryptedObjectUploads)
-> Either
     String
     (Maybe Integer
      -> Maybe Integer
      -> Maybe BucketCountByEncryptionType
      -> Int
      -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x
                            Object
-> Text
-> Either
     String (Maybe BucketCountPolicyAllowsUnencryptedObjectUploads)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"bucketCountByObjectEncryptionRequirement"
                        )
            Either
  String
  (Maybe Integer
   -> Maybe Integer
   -> Maybe BucketCountByEncryptionType
   -> Int
   -> GetBucketStatisticsResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe Integer
      -> Maybe BucketCountByEncryptionType
      -> Int
      -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"objectCount")
            Either
  String
  (Maybe Integer
   -> Maybe BucketCountByEncryptionType
   -> Int
   -> GetBucketStatisticsResponse)
-> Either String (Maybe Integer)
-> Either
     String
     (Maybe BucketCountByEncryptionType
      -> Int -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"classifiableSizeInBytes")
            Either
  String
  (Maybe BucketCountByEncryptionType
   -> Int -> GetBucketStatisticsResponse)
-> Either String (Maybe BucketCountByEncryptionType)
-> Either String (Int -> GetBucketStatisticsResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Either String (Maybe BucketCountByEncryptionType)
forall a. FromJSON a => Object -> Text -> Either String (Maybe a)
Core..?> Text
"bucketCountByEncryptionType")
            Either String (Int -> GetBucketStatisticsResponse)
-> Either String Int -> Either String GetBucketStatisticsResponse
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Int -> Either String Int
forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (Int -> Int
forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
      )

instance Prelude.Hashable GetBucketStatistics

instance Prelude.NFData GetBucketStatistics

instance Core.ToHeaders GetBucketStatistics where
  toHeaders :: GetBucketStatistics -> ResponseHeaders
toHeaders =
    ResponseHeaders -> GetBucketStatistics -> ResponseHeaders
forall a b. a -> b -> a
Prelude.const
      ( [ResponseHeaders] -> ResponseHeaders
forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"Content-Type"
              HeaderName -> ByteString -> ResponseHeaders
forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Core.=# ( ByteString
"application/x-amz-json-1.1" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Core.ToJSON GetBucketStatistics where
  toJSON :: GetBucketStatistics -> Value
toJSON GetBucketStatistics' {Maybe Text
accountId :: Maybe Text
$sel:accountId:GetBucketStatistics' :: GetBucketStatistics -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"accountId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
accountId]
      )

instance Core.ToPath GetBucketStatistics where
  toPath :: GetBucketStatistics -> ByteString
toPath = ByteString -> GetBucketStatistics -> ByteString
forall a b. a -> b -> a
Prelude.const ByteString
"/datasources/s3/statistics"

instance Core.ToQuery GetBucketStatistics where
  toQuery :: GetBucketStatistics -> QueryString
toQuery = QueryString -> GetBucketStatistics -> QueryString
forall a b. a -> b -> a
Prelude.const QueryString
forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newGetBucketStatisticsResponse' smart constructor.
data GetBucketStatisticsResponse = GetBucketStatisticsResponse'
  { -- | The total storage size, in bytes, of the objects that are compressed
    -- (.gz, .gzip, .zip) files in the buckets.
    --
    -- If versioning is enabled for any of the buckets, Amazon Macie calculates
    -- this value based on the size of the latest version of each applicable
    -- object in those buckets. This value doesn\'t reflect the storage size of
    -- all versions of the applicable objects in the buckets.
    GetBucketStatisticsResponse -> Maybe Integer
sizeInBytesCompressed :: Prelude.Maybe Prelude.Integer,
    -- | The date and time, in UTC and extended ISO 8601 format, when Amazon
    -- Macie most recently retrieved both bucket and object metadata from
    -- Amazon S3 for the buckets.
    GetBucketStatisticsResponse -> Maybe POSIX
lastUpdated :: Prelude.Maybe Core.POSIX,
    -- | The total storage size, in bytes, of the buckets.
    --
    -- If versioning is enabled for any of the buckets, Amazon Macie calculates
    -- this value based on the size of the latest version of each object in
    -- those buckets. This value doesn\'t reflect the storage size of all
    -- versions of the objects in the buckets.
    GetBucketStatisticsResponse -> Maybe Integer
sizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets that are or aren\'t shared with another
    -- Amazon Web Services account.
    GetBucketStatisticsResponse -> Maybe BucketCountBySharedAccessType
bucketCountBySharedAccessType :: Prelude.Maybe BucketCountBySharedAccessType,
    -- | The total number of 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.
    GetBucketStatisticsResponse -> Maybe Integer
classifiableObjectCount :: Prelude.Maybe Prelude.Integer,
    -- | The total storage size, in bytes, of the objects that Amazon Macie
    -- can\'t analyze in the buckets. These objects don\'t use a supported
    -- storage class or don\'t have a file name extension for a supported file
    -- or storage format.
    GetBucketStatisticsResponse -> Maybe ObjectLevelStatistics
unclassifiableObjectSizeInBytes :: Prelude.Maybe ObjectLevelStatistics,
    -- | The total number of objects that Amazon Macie can\'t analyze in the
    -- buckets. These objects don\'t use a supported storage class or don\'t
    -- have a file name extension for a supported file or storage format.
    GetBucketStatisticsResponse -> Maybe ObjectLevelStatistics
unclassifiableObjectCount :: Prelude.Maybe ObjectLevelStatistics,
    -- | The total number of buckets.
    GetBucketStatisticsResponse -> Maybe Integer
bucketCount :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets that are publicly accessible based on a
    -- combination of permissions settings for each bucket.
    GetBucketStatisticsResponse
-> Maybe BucketCountByEffectivePermission
bucketCountByEffectivePermission :: Prelude.Maybe BucketCountByEffectivePermission,
    -- | The total number of buckets whose bucket policies do or don\'t require
    -- server-side encryption of objects when objects are uploaded to the
    -- buckets.
    GetBucketStatisticsResponse
-> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
bucketCountByObjectEncryptionRequirement :: Prelude.Maybe BucketCountPolicyAllowsUnencryptedObjectUploads,
    -- | The total number of objects in the buckets.
    GetBucketStatisticsResponse -> Maybe Integer
objectCount :: Prelude.Maybe Prelude.Integer,
    -- | 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, Macie calculates this
    -- value based on the size of the latest version of each applicable object
    -- in those buckets. This value doesn\'t reflect the storage size of all
    -- versions of all applicable objects in the buckets.
    GetBucketStatisticsResponse -> Maybe Integer
classifiableSizeInBytes :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets that use certain types of server-side
    -- encryption to encrypt new objects by default. This object also reports
    -- the total number of buckets that don\'t encrypt new objects by default.
    GetBucketStatisticsResponse -> Maybe BucketCountByEncryptionType
bucketCountByEncryptionType :: Prelude.Maybe BucketCountByEncryptionType,
    -- | The response's http status code.
    GetBucketStatisticsResponse -> Int
httpStatus :: Prelude.Int
  }
  deriving (GetBucketStatisticsResponse -> GetBucketStatisticsResponse -> Bool
(GetBucketStatisticsResponse
 -> GetBucketStatisticsResponse -> Bool)
-> (GetBucketStatisticsResponse
    -> GetBucketStatisticsResponse -> Bool)
-> Eq GetBucketStatisticsResponse
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GetBucketStatisticsResponse -> GetBucketStatisticsResponse -> Bool
$c/= :: GetBucketStatisticsResponse -> GetBucketStatisticsResponse -> Bool
== :: GetBucketStatisticsResponse -> GetBucketStatisticsResponse -> Bool
$c== :: GetBucketStatisticsResponse -> GetBucketStatisticsResponse -> Bool
Prelude.Eq, ReadPrec [GetBucketStatisticsResponse]
ReadPrec GetBucketStatisticsResponse
Int -> ReadS GetBucketStatisticsResponse
ReadS [GetBucketStatisticsResponse]
(Int -> ReadS GetBucketStatisticsResponse)
-> ReadS [GetBucketStatisticsResponse]
-> ReadPrec GetBucketStatisticsResponse
-> ReadPrec [GetBucketStatisticsResponse]
-> Read GetBucketStatisticsResponse
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GetBucketStatisticsResponse]
$creadListPrec :: ReadPrec [GetBucketStatisticsResponse]
readPrec :: ReadPrec GetBucketStatisticsResponse
$creadPrec :: ReadPrec GetBucketStatisticsResponse
readList :: ReadS [GetBucketStatisticsResponse]
$creadList :: ReadS [GetBucketStatisticsResponse]
readsPrec :: Int -> ReadS GetBucketStatisticsResponse
$creadsPrec :: Int -> ReadS GetBucketStatisticsResponse
Prelude.Read, Int -> GetBucketStatisticsResponse -> ShowS
[GetBucketStatisticsResponse] -> ShowS
GetBucketStatisticsResponse -> String
(Int -> GetBucketStatisticsResponse -> ShowS)
-> (GetBucketStatisticsResponse -> String)
-> ([GetBucketStatisticsResponse] -> ShowS)
-> Show GetBucketStatisticsResponse
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GetBucketStatisticsResponse] -> ShowS
$cshowList :: [GetBucketStatisticsResponse] -> ShowS
show :: GetBucketStatisticsResponse -> String
$cshow :: GetBucketStatisticsResponse -> String
showsPrec :: Int -> GetBucketStatisticsResponse -> ShowS
$cshowsPrec :: Int -> GetBucketStatisticsResponse -> ShowS
Prelude.Show, (forall x.
 GetBucketStatisticsResponse -> Rep GetBucketStatisticsResponse x)
-> (forall x.
    Rep GetBucketStatisticsResponse x -> GetBucketStatisticsResponse)
-> Generic GetBucketStatisticsResponse
forall x.
Rep GetBucketStatisticsResponse x -> GetBucketStatisticsResponse
forall x.
GetBucketStatisticsResponse -> Rep GetBucketStatisticsResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep GetBucketStatisticsResponse x -> GetBucketStatisticsResponse
$cfrom :: forall x.
GetBucketStatisticsResponse -> Rep GetBucketStatisticsResponse x
Prelude.Generic)

-- |
-- Create a value of 'GetBucketStatisticsResponse' 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', 'getBucketStatisticsResponse_sizeInBytesCompressed' - The total storage size, in bytes, of the objects that are compressed
-- (.gz, .gzip, .zip) files in the buckets.
--
-- If versioning is enabled for any of the buckets, Amazon Macie calculates
-- this value based on the size of the latest version of each applicable
-- object in those buckets. This value doesn\'t reflect the storage size of
-- all versions of the applicable objects in the buckets.
--
-- 'lastUpdated', 'getBucketStatisticsResponse_lastUpdated' - The date and time, in UTC and extended ISO 8601 format, when Amazon
-- Macie most recently retrieved both bucket and object metadata from
-- Amazon S3 for the buckets.
--
-- 'sizeInBytes', 'getBucketStatisticsResponse_sizeInBytes' - The total storage size, in bytes, of the buckets.
--
-- If versioning is enabled for any of the buckets, Amazon Macie calculates
-- this value based on the size of the latest version of each object in
-- those buckets. This value doesn\'t reflect the storage size of all
-- versions of the objects in the buckets.
--
-- 'bucketCountBySharedAccessType', 'getBucketStatisticsResponse_bucketCountBySharedAccessType' - The total number of buckets that are or aren\'t shared with another
-- Amazon Web Services account.
--
-- 'classifiableObjectCount', 'getBucketStatisticsResponse_classifiableObjectCount' - The total number of 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.
--
-- 'unclassifiableObjectSizeInBytes', 'getBucketStatisticsResponse_unclassifiableObjectSizeInBytes' - The total storage size, in bytes, of the objects that Amazon Macie
-- can\'t analyze in the buckets. 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', 'getBucketStatisticsResponse_unclassifiableObjectCount' - The total number of objects that Amazon Macie can\'t analyze in the
-- buckets. These objects don\'t use a supported storage class or don\'t
-- have a file name extension for a supported file or storage format.
--
-- 'bucketCount', 'getBucketStatisticsResponse_bucketCount' - The total number of buckets.
--
-- 'bucketCountByEffectivePermission', 'getBucketStatisticsResponse_bucketCountByEffectivePermission' - The total number of buckets that are publicly accessible based on a
-- combination of permissions settings for each bucket.
--
-- 'bucketCountByObjectEncryptionRequirement', 'getBucketStatisticsResponse_bucketCountByObjectEncryptionRequirement' - The total number of buckets whose bucket policies do or don\'t require
-- server-side encryption of objects when objects are uploaded to the
-- buckets.
--
-- 'objectCount', 'getBucketStatisticsResponse_objectCount' - The total number of objects in the buckets.
--
-- 'classifiableSizeInBytes', 'getBucketStatisticsResponse_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, Macie calculates this
-- value based on the size of the latest version of each applicable object
-- in those buckets. This value doesn\'t reflect the storage size of all
-- versions of all applicable objects in the buckets.
--
-- 'bucketCountByEncryptionType', 'getBucketStatisticsResponse_bucketCountByEncryptionType' - The total number of buckets that use certain types of server-side
-- encryption to encrypt new objects by default. This object also reports
-- the total number of buckets that don\'t encrypt new objects by default.
--
-- 'httpStatus', 'getBucketStatisticsResponse_httpStatus' - The response's http status code.
newGetBucketStatisticsResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  GetBucketStatisticsResponse
newGetBucketStatisticsResponse :: Int -> GetBucketStatisticsResponse
newGetBucketStatisticsResponse Int
pHttpStatus_ =
  GetBucketStatisticsResponse' :: Maybe Integer
-> Maybe POSIX
-> Maybe Integer
-> Maybe BucketCountBySharedAccessType
-> Maybe Integer
-> Maybe ObjectLevelStatistics
-> Maybe ObjectLevelStatistics
-> Maybe Integer
-> Maybe BucketCountByEffectivePermission
-> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
-> Maybe Integer
-> Maybe Integer
-> Maybe BucketCountByEncryptionType
-> Int
-> GetBucketStatisticsResponse
GetBucketStatisticsResponse'
    { $sel:sizeInBytesCompressed:GetBucketStatisticsResponse' :: Maybe Integer
sizeInBytesCompressed =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:lastUpdated:GetBucketStatisticsResponse' :: Maybe POSIX
lastUpdated = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
      $sel:sizeInBytes:GetBucketStatisticsResponse' :: Maybe Integer
sizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketCountBySharedAccessType:GetBucketStatisticsResponse' :: Maybe BucketCountBySharedAccessType
bucketCountBySharedAccessType =
        Maybe BucketCountBySharedAccessType
forall a. Maybe a
Prelude.Nothing,
      $sel:classifiableObjectCount:GetBucketStatisticsResponse' :: Maybe Integer
classifiableObjectCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:unclassifiableObjectSizeInBytes:GetBucketStatisticsResponse' :: Maybe ObjectLevelStatistics
unclassifiableObjectSizeInBytes =
        Maybe ObjectLevelStatistics
forall a. Maybe a
Prelude.Nothing,
      $sel:unclassifiableObjectCount:GetBucketStatisticsResponse' :: Maybe ObjectLevelStatistics
unclassifiableObjectCount = Maybe ObjectLevelStatistics
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketCount:GetBucketStatisticsResponse' :: Maybe Integer
bucketCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketCountByEffectivePermission:GetBucketStatisticsResponse' :: Maybe BucketCountByEffectivePermission
bucketCountByEffectivePermission =
        Maybe BucketCountByEffectivePermission
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketCountByObjectEncryptionRequirement:GetBucketStatisticsResponse' :: Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
bucketCountByObjectEncryptionRequirement =
        Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
forall a. Maybe a
Prelude.Nothing,
      $sel:objectCount:GetBucketStatisticsResponse' :: Maybe Integer
objectCount = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:classifiableSizeInBytes:GetBucketStatisticsResponse' :: Maybe Integer
classifiableSizeInBytes = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketCountByEncryptionType:GetBucketStatisticsResponse' :: Maybe BucketCountByEncryptionType
bucketCountByEncryptionType = Maybe BucketCountByEncryptionType
forall a. Maybe a
Prelude.Nothing,
      $sel:httpStatus:GetBucketStatisticsResponse' :: Int
httpStatus = Int
pHttpStatus_
    }

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

-- | The date and time, in UTC and extended ISO 8601 format, when Amazon
-- Macie most recently retrieved both bucket and object metadata from
-- Amazon S3 for the buckets.
getBucketStatisticsResponse_lastUpdated :: Lens.Lens' GetBucketStatisticsResponse (Prelude.Maybe Prelude.UTCTime)
getBucketStatisticsResponse_lastUpdated :: (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBucketStatisticsResponse -> f GetBucketStatisticsResponse
getBucketStatisticsResponse_lastUpdated = (GetBucketStatisticsResponse -> Maybe POSIX)
-> (GetBucketStatisticsResponse
    -> Maybe POSIX -> GetBucketStatisticsResponse)
-> Lens
     GetBucketStatisticsResponse
     GetBucketStatisticsResponse
     (Maybe POSIX)
     (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketStatisticsResponse' {Maybe POSIX
lastUpdated :: Maybe POSIX
$sel:lastUpdated:GetBucketStatisticsResponse' :: GetBucketStatisticsResponse -> Maybe POSIX
lastUpdated} -> Maybe POSIX
lastUpdated) (\s :: GetBucketStatisticsResponse
s@GetBucketStatisticsResponse' {} Maybe POSIX
a -> GetBucketStatisticsResponse
s {$sel:lastUpdated:GetBucketStatisticsResponse' :: Maybe POSIX
lastUpdated = Maybe POSIX
a} :: GetBucketStatisticsResponse) ((Maybe POSIX -> f (Maybe POSIX))
 -> GetBucketStatisticsResponse -> f GetBucketStatisticsResponse)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
    -> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> GetBucketStatisticsResponse
-> f GetBucketStatisticsResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
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 AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time

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

-- | The total number of buckets that are or aren\'t shared with another
-- Amazon Web Services account.
getBucketStatisticsResponse_bucketCountBySharedAccessType :: Lens.Lens' GetBucketStatisticsResponse (Prelude.Maybe BucketCountBySharedAccessType)
getBucketStatisticsResponse_bucketCountBySharedAccessType :: (Maybe BucketCountBySharedAccessType
 -> f (Maybe BucketCountBySharedAccessType))
-> GetBucketStatisticsResponse -> f GetBucketStatisticsResponse
getBucketStatisticsResponse_bucketCountBySharedAccessType = (GetBucketStatisticsResponse
 -> Maybe BucketCountBySharedAccessType)
-> (GetBucketStatisticsResponse
    -> Maybe BucketCountBySharedAccessType
    -> GetBucketStatisticsResponse)
-> Lens
     GetBucketStatisticsResponse
     GetBucketStatisticsResponse
     (Maybe BucketCountBySharedAccessType)
     (Maybe BucketCountBySharedAccessType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketStatisticsResponse' {Maybe BucketCountBySharedAccessType
bucketCountBySharedAccessType :: Maybe BucketCountBySharedAccessType
$sel:bucketCountBySharedAccessType:GetBucketStatisticsResponse' :: GetBucketStatisticsResponse -> Maybe BucketCountBySharedAccessType
bucketCountBySharedAccessType} -> Maybe BucketCountBySharedAccessType
bucketCountBySharedAccessType) (\s :: GetBucketStatisticsResponse
s@GetBucketStatisticsResponse' {} Maybe BucketCountBySharedAccessType
a -> GetBucketStatisticsResponse
s {$sel:bucketCountBySharedAccessType:GetBucketStatisticsResponse' :: Maybe BucketCountBySharedAccessType
bucketCountBySharedAccessType = Maybe BucketCountBySharedAccessType
a} :: GetBucketStatisticsResponse)

-- | The total number of 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.
getBucketStatisticsResponse_classifiableObjectCount :: Lens.Lens' GetBucketStatisticsResponse (Prelude.Maybe Prelude.Integer)
getBucketStatisticsResponse_classifiableObjectCount :: (Maybe Integer -> f (Maybe Integer))
-> GetBucketStatisticsResponse -> f GetBucketStatisticsResponse
getBucketStatisticsResponse_classifiableObjectCount = (GetBucketStatisticsResponse -> Maybe Integer)
-> (GetBucketStatisticsResponse
    -> Maybe Integer -> GetBucketStatisticsResponse)
-> Lens
     GetBucketStatisticsResponse
     GetBucketStatisticsResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketStatisticsResponse' {Maybe Integer
classifiableObjectCount :: Maybe Integer
$sel:classifiableObjectCount:GetBucketStatisticsResponse' :: GetBucketStatisticsResponse -> Maybe Integer
classifiableObjectCount} -> Maybe Integer
classifiableObjectCount) (\s :: GetBucketStatisticsResponse
s@GetBucketStatisticsResponse' {} Maybe Integer
a -> GetBucketStatisticsResponse
s {$sel:classifiableObjectCount:GetBucketStatisticsResponse' :: Maybe Integer
classifiableObjectCount = Maybe Integer
a} :: GetBucketStatisticsResponse)

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

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

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

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

-- | The total number of buckets whose bucket policies do or don\'t require
-- server-side encryption of objects when objects are uploaded to the
-- buckets.
getBucketStatisticsResponse_bucketCountByObjectEncryptionRequirement :: Lens.Lens' GetBucketStatisticsResponse (Prelude.Maybe BucketCountPolicyAllowsUnencryptedObjectUploads)
getBucketStatisticsResponse_bucketCountByObjectEncryptionRequirement :: (Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
 -> f (Maybe BucketCountPolicyAllowsUnencryptedObjectUploads))
-> GetBucketStatisticsResponse -> f GetBucketStatisticsResponse
getBucketStatisticsResponse_bucketCountByObjectEncryptionRequirement = (GetBucketStatisticsResponse
 -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads)
-> (GetBucketStatisticsResponse
    -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
    -> GetBucketStatisticsResponse)
-> Lens
     GetBucketStatisticsResponse
     GetBucketStatisticsResponse
     (Maybe BucketCountPolicyAllowsUnencryptedObjectUploads)
     (Maybe BucketCountPolicyAllowsUnencryptedObjectUploads)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketStatisticsResponse' {Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
bucketCountByObjectEncryptionRequirement :: Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
$sel:bucketCountByObjectEncryptionRequirement:GetBucketStatisticsResponse' :: GetBucketStatisticsResponse
-> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
bucketCountByObjectEncryptionRequirement} -> Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
bucketCountByObjectEncryptionRequirement) (\s :: GetBucketStatisticsResponse
s@GetBucketStatisticsResponse' {} Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
a -> GetBucketStatisticsResponse
s {$sel:bucketCountByObjectEncryptionRequirement:GetBucketStatisticsResponse' :: Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
bucketCountByObjectEncryptionRequirement = Maybe BucketCountPolicyAllowsUnencryptedObjectUploads
a} :: GetBucketStatisticsResponse)

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

-- | 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, Macie calculates this
-- value based on the size of the latest version of each applicable object
-- in those buckets. This value doesn\'t reflect the storage size of all
-- versions of all applicable objects in the buckets.
getBucketStatisticsResponse_classifiableSizeInBytes :: Lens.Lens' GetBucketStatisticsResponse (Prelude.Maybe Prelude.Integer)
getBucketStatisticsResponse_classifiableSizeInBytes :: (Maybe Integer -> f (Maybe Integer))
-> GetBucketStatisticsResponse -> f GetBucketStatisticsResponse
getBucketStatisticsResponse_classifiableSizeInBytes = (GetBucketStatisticsResponse -> Maybe Integer)
-> (GetBucketStatisticsResponse
    -> Maybe Integer -> GetBucketStatisticsResponse)
-> Lens
     GetBucketStatisticsResponse
     GetBucketStatisticsResponse
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketStatisticsResponse' {Maybe Integer
classifiableSizeInBytes :: Maybe Integer
$sel:classifiableSizeInBytes:GetBucketStatisticsResponse' :: GetBucketStatisticsResponse -> Maybe Integer
classifiableSizeInBytes} -> Maybe Integer
classifiableSizeInBytes) (\s :: GetBucketStatisticsResponse
s@GetBucketStatisticsResponse' {} Maybe Integer
a -> GetBucketStatisticsResponse
s {$sel:classifiableSizeInBytes:GetBucketStatisticsResponse' :: Maybe Integer
classifiableSizeInBytes = Maybe Integer
a} :: GetBucketStatisticsResponse)

-- | The total number of buckets that use certain types of server-side
-- encryption to encrypt new objects by default. This object also reports
-- the total number of buckets that don\'t encrypt new objects by default.
getBucketStatisticsResponse_bucketCountByEncryptionType :: Lens.Lens' GetBucketStatisticsResponse (Prelude.Maybe BucketCountByEncryptionType)
getBucketStatisticsResponse_bucketCountByEncryptionType :: (Maybe BucketCountByEncryptionType
 -> f (Maybe BucketCountByEncryptionType))
-> GetBucketStatisticsResponse -> f GetBucketStatisticsResponse
getBucketStatisticsResponse_bucketCountByEncryptionType = (GetBucketStatisticsResponse -> Maybe BucketCountByEncryptionType)
-> (GetBucketStatisticsResponse
    -> Maybe BucketCountByEncryptionType
    -> GetBucketStatisticsResponse)
-> Lens
     GetBucketStatisticsResponse
     GetBucketStatisticsResponse
     (Maybe BucketCountByEncryptionType)
     (Maybe BucketCountByEncryptionType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketStatisticsResponse' {Maybe BucketCountByEncryptionType
bucketCountByEncryptionType :: Maybe BucketCountByEncryptionType
$sel:bucketCountByEncryptionType:GetBucketStatisticsResponse' :: GetBucketStatisticsResponse -> Maybe BucketCountByEncryptionType
bucketCountByEncryptionType} -> Maybe BucketCountByEncryptionType
bucketCountByEncryptionType) (\s :: GetBucketStatisticsResponse
s@GetBucketStatisticsResponse' {} Maybe BucketCountByEncryptionType
a -> GetBucketStatisticsResponse
s {$sel:bucketCountByEncryptionType:GetBucketStatisticsResponse' :: Maybe BucketCountByEncryptionType
bucketCountByEncryptionType = Maybe BucketCountByEncryptionType
a} :: GetBucketStatisticsResponse)

-- | The response's http status code.
getBucketStatisticsResponse_httpStatus :: Lens.Lens' GetBucketStatisticsResponse Prelude.Int
getBucketStatisticsResponse_httpStatus :: (Int -> f Int)
-> GetBucketStatisticsResponse -> f GetBucketStatisticsResponse
getBucketStatisticsResponse_httpStatus = (GetBucketStatisticsResponse -> Int)
-> (GetBucketStatisticsResponse
    -> Int -> GetBucketStatisticsResponse)
-> Lens
     GetBucketStatisticsResponse GetBucketStatisticsResponse Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GetBucketStatisticsResponse' {Int
httpStatus :: Int
$sel:httpStatus:GetBucketStatisticsResponse' :: GetBucketStatisticsResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: GetBucketStatisticsResponse
s@GetBucketStatisticsResponse' {} Int
a -> GetBucketStatisticsResponse
s {$sel:httpStatus:GetBucketStatisticsResponse' :: Int
httpStatus = Int
a} :: GetBucketStatisticsResponse)

instance Prelude.NFData GetBucketStatisticsResponse