{-# 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.BucketCountByEncryptionType
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MacieV2.Types.BucketCountByEncryptionType where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude

-- | Provides information about the number of S3 buckets that use certain
-- types of server-side encryption by default or don\'t encrypt new objects
-- by default. For detailed information about these settings, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/userguide/bucket-encryption.html Setting default server-side encryption behavior for Amazon S3 buckets>
-- in the /Amazon Simple Storage Service User Guide/.
--
-- /See:/ 'newBucketCountByEncryptionType' smart constructor.
data BucketCountByEncryptionType = BucketCountByEncryptionType'
  { -- | The total number of buckets that use an KMS key to encrypt new objects
    -- by default, either an Amazon Web Services managed key or a customer
    -- managed key. These buckets use KMS encryption (SSE-KMS) by default.
    BucketCountByEncryptionType -> Maybe Integer
kmsManaged :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets that use an Amazon S3 managed key to encrypt
    -- new objects by default. These buckets use Amazon S3 managed encryption
    -- (SSE-S3) by default.
    BucketCountByEncryptionType -> Maybe Integer
s3Managed :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets that don\'t encrypt new objects by default.
    -- Default encryption is disabled for these buckets.
    BucketCountByEncryptionType -> Maybe Integer
unencrypted :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets that Amazon Macie doesn\'t have current
    -- encryption metadata for. Macie can\'t provide current data about the
    -- default encryption settings for these buckets.
    BucketCountByEncryptionType -> Maybe Integer
unknown :: Prelude.Maybe Prelude.Integer
  }
  deriving (BucketCountByEncryptionType -> BucketCountByEncryptionType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BucketCountByEncryptionType -> BucketCountByEncryptionType -> Bool
$c/= :: BucketCountByEncryptionType -> BucketCountByEncryptionType -> Bool
== :: BucketCountByEncryptionType -> BucketCountByEncryptionType -> Bool
$c== :: BucketCountByEncryptionType -> BucketCountByEncryptionType -> Bool
Prelude.Eq, ReadPrec [BucketCountByEncryptionType]
ReadPrec BucketCountByEncryptionType
Int -> ReadS BucketCountByEncryptionType
ReadS [BucketCountByEncryptionType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BucketCountByEncryptionType]
$creadListPrec :: ReadPrec [BucketCountByEncryptionType]
readPrec :: ReadPrec BucketCountByEncryptionType
$creadPrec :: ReadPrec BucketCountByEncryptionType
readList :: ReadS [BucketCountByEncryptionType]
$creadList :: ReadS [BucketCountByEncryptionType]
readsPrec :: Int -> ReadS BucketCountByEncryptionType
$creadsPrec :: Int -> ReadS BucketCountByEncryptionType
Prelude.Read, Int -> BucketCountByEncryptionType -> ShowS
[BucketCountByEncryptionType] -> ShowS
BucketCountByEncryptionType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BucketCountByEncryptionType] -> ShowS
$cshowList :: [BucketCountByEncryptionType] -> ShowS
show :: BucketCountByEncryptionType -> String
$cshow :: BucketCountByEncryptionType -> String
showsPrec :: Int -> BucketCountByEncryptionType -> ShowS
$cshowsPrec :: Int -> BucketCountByEncryptionType -> ShowS
Prelude.Show, forall x.
Rep BucketCountByEncryptionType x -> BucketCountByEncryptionType
forall x.
BucketCountByEncryptionType -> Rep BucketCountByEncryptionType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BucketCountByEncryptionType x -> BucketCountByEncryptionType
$cfrom :: forall x.
BucketCountByEncryptionType -> Rep BucketCountByEncryptionType x
Prelude.Generic)

-- |
-- Create a value of 'BucketCountByEncryptionType' 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:
--
-- 'kmsManaged', 'bucketCountByEncryptionType_kmsManaged' - The total number of buckets that use an KMS key to encrypt new objects
-- by default, either an Amazon Web Services managed key or a customer
-- managed key. These buckets use KMS encryption (SSE-KMS) by default.
--
-- 's3Managed', 'bucketCountByEncryptionType_s3Managed' - The total number of buckets that use an Amazon S3 managed key to encrypt
-- new objects by default. These buckets use Amazon S3 managed encryption
-- (SSE-S3) by default.
--
-- 'unencrypted', 'bucketCountByEncryptionType_unencrypted' - The total number of buckets that don\'t encrypt new objects by default.
-- Default encryption is disabled for these buckets.
--
-- 'unknown', 'bucketCountByEncryptionType_unknown' - The total number of buckets that Amazon Macie doesn\'t have current
-- encryption metadata for. Macie can\'t provide current data about the
-- default encryption settings for these buckets.
newBucketCountByEncryptionType ::
  BucketCountByEncryptionType
newBucketCountByEncryptionType :: BucketCountByEncryptionType
newBucketCountByEncryptionType =
  BucketCountByEncryptionType'
    { $sel:kmsManaged:BucketCountByEncryptionType' :: Maybe Integer
kmsManaged =
        forall a. Maybe a
Prelude.Nothing,
      $sel:s3Managed:BucketCountByEncryptionType' :: Maybe Integer
s3Managed = forall a. Maybe a
Prelude.Nothing,
      $sel:unencrypted:BucketCountByEncryptionType' :: Maybe Integer
unencrypted = forall a. Maybe a
Prelude.Nothing,
      $sel:unknown:BucketCountByEncryptionType' :: Maybe Integer
unknown = forall a. Maybe a
Prelude.Nothing
    }

-- | The total number of buckets that use an KMS key to encrypt new objects
-- by default, either an Amazon Web Services managed key or a customer
-- managed key. These buckets use KMS encryption (SSE-KMS) by default.
bucketCountByEncryptionType_kmsManaged :: Lens.Lens' BucketCountByEncryptionType (Prelude.Maybe Prelude.Integer)
bucketCountByEncryptionType_kmsManaged :: Lens' BucketCountByEncryptionType (Maybe Integer)
bucketCountByEncryptionType_kmsManaged = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCountByEncryptionType' {Maybe Integer
kmsManaged :: Maybe Integer
$sel:kmsManaged:BucketCountByEncryptionType' :: BucketCountByEncryptionType -> Maybe Integer
kmsManaged} -> Maybe Integer
kmsManaged) (\s :: BucketCountByEncryptionType
s@BucketCountByEncryptionType' {} Maybe Integer
a -> BucketCountByEncryptionType
s {$sel:kmsManaged:BucketCountByEncryptionType' :: Maybe Integer
kmsManaged = Maybe Integer
a} :: BucketCountByEncryptionType)

-- | The total number of buckets that use an Amazon S3 managed key to encrypt
-- new objects by default. These buckets use Amazon S3 managed encryption
-- (SSE-S3) by default.
bucketCountByEncryptionType_s3Managed :: Lens.Lens' BucketCountByEncryptionType (Prelude.Maybe Prelude.Integer)
bucketCountByEncryptionType_s3Managed :: Lens' BucketCountByEncryptionType (Maybe Integer)
bucketCountByEncryptionType_s3Managed = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCountByEncryptionType' {Maybe Integer
s3Managed :: Maybe Integer
$sel:s3Managed:BucketCountByEncryptionType' :: BucketCountByEncryptionType -> Maybe Integer
s3Managed} -> Maybe Integer
s3Managed) (\s :: BucketCountByEncryptionType
s@BucketCountByEncryptionType' {} Maybe Integer
a -> BucketCountByEncryptionType
s {$sel:s3Managed:BucketCountByEncryptionType' :: Maybe Integer
s3Managed = Maybe Integer
a} :: BucketCountByEncryptionType)

-- | The total number of buckets that don\'t encrypt new objects by default.
-- Default encryption is disabled for these buckets.
bucketCountByEncryptionType_unencrypted :: Lens.Lens' BucketCountByEncryptionType (Prelude.Maybe Prelude.Integer)
bucketCountByEncryptionType_unencrypted :: Lens' BucketCountByEncryptionType (Maybe Integer)
bucketCountByEncryptionType_unencrypted = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCountByEncryptionType' {Maybe Integer
unencrypted :: Maybe Integer
$sel:unencrypted:BucketCountByEncryptionType' :: BucketCountByEncryptionType -> Maybe Integer
unencrypted} -> Maybe Integer
unencrypted) (\s :: BucketCountByEncryptionType
s@BucketCountByEncryptionType' {} Maybe Integer
a -> BucketCountByEncryptionType
s {$sel:unencrypted:BucketCountByEncryptionType' :: Maybe Integer
unencrypted = Maybe Integer
a} :: BucketCountByEncryptionType)

-- | The total number of buckets that Amazon Macie doesn\'t have current
-- encryption metadata for. Macie can\'t provide current data about the
-- default encryption settings for these buckets.
bucketCountByEncryptionType_unknown :: Lens.Lens' BucketCountByEncryptionType (Prelude.Maybe Prelude.Integer)
bucketCountByEncryptionType_unknown :: Lens' BucketCountByEncryptionType (Maybe Integer)
bucketCountByEncryptionType_unknown = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCountByEncryptionType' {Maybe Integer
unknown :: Maybe Integer
$sel:unknown:BucketCountByEncryptionType' :: BucketCountByEncryptionType -> Maybe Integer
unknown} -> Maybe Integer
unknown) (\s :: BucketCountByEncryptionType
s@BucketCountByEncryptionType' {} Maybe Integer
a -> BucketCountByEncryptionType
s {$sel:unknown:BucketCountByEncryptionType' :: Maybe Integer
unknown = Maybe Integer
a} :: BucketCountByEncryptionType)

instance Data.FromJSON BucketCountByEncryptionType where
  parseJSON :: Value -> Parser BucketCountByEncryptionType
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BucketCountByEncryptionType"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> BucketCountByEncryptionType
BucketCountByEncryptionType'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"kmsManaged")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"s3Managed")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"unencrypted")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"unknown")
      )

instance Prelude.Hashable BucketCountByEncryptionType where
  hashWithSalt :: Int -> BucketCountByEncryptionType -> Int
hashWithSalt Int
_salt BucketCountByEncryptionType' {Maybe Integer
unknown :: Maybe Integer
unencrypted :: Maybe Integer
s3Managed :: Maybe Integer
kmsManaged :: Maybe Integer
$sel:unknown:BucketCountByEncryptionType' :: BucketCountByEncryptionType -> Maybe Integer
$sel:unencrypted:BucketCountByEncryptionType' :: BucketCountByEncryptionType -> Maybe Integer
$sel:s3Managed:BucketCountByEncryptionType' :: BucketCountByEncryptionType -> Maybe Integer
$sel:kmsManaged:BucketCountByEncryptionType' :: BucketCountByEncryptionType -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
kmsManaged
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
s3Managed
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
unencrypted
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
unknown

instance Prelude.NFData BucketCountByEncryptionType where
  rnf :: BucketCountByEncryptionType -> ()
rnf BucketCountByEncryptionType' {Maybe Integer
unknown :: Maybe Integer
unencrypted :: Maybe Integer
s3Managed :: Maybe Integer
kmsManaged :: Maybe Integer
$sel:unknown:BucketCountByEncryptionType' :: BucketCountByEncryptionType -> Maybe Integer
$sel:unencrypted:BucketCountByEncryptionType' :: BucketCountByEncryptionType -> Maybe Integer
$sel:s3Managed:BucketCountByEncryptionType' :: BucketCountByEncryptionType -> Maybe Integer
$sel:kmsManaged:BucketCountByEncryptionType' :: BucketCountByEncryptionType -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
kmsManaged
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
s3Managed
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
unencrypted
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
unknown