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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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 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,
    -- | 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 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
  }
  deriving (BucketCountByEncryptionType -> BucketCountByEncryptionType -> Bool
(BucketCountByEncryptionType
 -> BucketCountByEncryptionType -> Bool)
-> (BucketCountByEncryptionType
    -> BucketCountByEncryptionType -> Bool)
-> Eq BucketCountByEncryptionType
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]
(Int -> ReadS BucketCountByEncryptionType)
-> ReadS [BucketCountByEncryptionType]
-> ReadPrec BucketCountByEncryptionType
-> ReadPrec [BucketCountByEncryptionType]
-> Read 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
(Int -> BucketCountByEncryptionType -> ShowS)
-> (BucketCountByEncryptionType -> String)
-> ([BucketCountByEncryptionType] -> ShowS)
-> Show BucketCountByEncryptionType
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.
 BucketCountByEncryptionType -> Rep BucketCountByEncryptionType x)
-> (forall x.
    Rep BucketCountByEncryptionType x -> BucketCountByEncryptionType)
-> Generic BucketCountByEncryptionType
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:
--
-- '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.
--
-- '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.
--
-- '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.
newBucketCountByEncryptionType ::
  BucketCountByEncryptionType
newBucketCountByEncryptionType :: BucketCountByEncryptionType
newBucketCountByEncryptionType =
  BucketCountByEncryptionType' :: Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> BucketCountByEncryptionType
BucketCountByEncryptionType'
    { $sel:unknown:BucketCountByEncryptionType' :: Maybe Integer
unknown =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:s3Managed:BucketCountByEncryptionType' :: Maybe Integer
s3Managed = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:unencrypted:BucketCountByEncryptionType' :: Maybe Integer
unencrypted = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsManaged:BucketCountByEncryptionType' :: Maybe Integer
kmsManaged = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: (Maybe Integer -> f (Maybe Integer))
-> BucketCountByEncryptionType -> f BucketCountByEncryptionType
bucketCountByEncryptionType_unknown = (BucketCountByEncryptionType -> Maybe Integer)
-> (BucketCountByEncryptionType
    -> Maybe Integer -> BucketCountByEncryptionType)
-> Lens
     BucketCountByEncryptionType
     BucketCountByEncryptionType
     (Maybe Integer)
     (Maybe Integer)
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)

-- | 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 :: (Maybe Integer -> f (Maybe Integer))
-> BucketCountByEncryptionType -> f BucketCountByEncryptionType
bucketCountByEncryptionType_s3Managed = (BucketCountByEncryptionType -> Maybe Integer)
-> (BucketCountByEncryptionType
    -> Maybe Integer -> BucketCountByEncryptionType)
-> Lens
     BucketCountByEncryptionType
     BucketCountByEncryptionType
     (Maybe Integer)
     (Maybe Integer)
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 :: (Maybe Integer -> f (Maybe Integer))
-> BucketCountByEncryptionType -> f BucketCountByEncryptionType
bucketCountByEncryptionType_unencrypted = (BucketCountByEncryptionType -> Maybe Integer)
-> (BucketCountByEncryptionType
    -> Maybe Integer -> BucketCountByEncryptionType)
-> Lens
     BucketCountByEncryptionType
     BucketCountByEncryptionType
     (Maybe Integer)
     (Maybe Integer)
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 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 :: (Maybe Integer -> f (Maybe Integer))
-> BucketCountByEncryptionType -> f BucketCountByEncryptionType
bucketCountByEncryptionType_kmsManaged = (BucketCountByEncryptionType -> Maybe Integer)
-> (BucketCountByEncryptionType
    -> Maybe Integer -> BucketCountByEncryptionType)
-> Lens
     BucketCountByEncryptionType
     BucketCountByEncryptionType
     (Maybe Integer)
     (Maybe Integer)
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)

instance Core.FromJSON BucketCountByEncryptionType where
  parseJSON :: Value -> Parser BucketCountByEncryptionType
parseJSON =
    String
-> (Object -> Parser BucketCountByEncryptionType)
-> Value
-> Parser BucketCountByEncryptionType
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"BucketCountByEncryptionType"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> BucketCountByEncryptionType
BucketCountByEncryptionType'
            (Maybe Integer
 -> Maybe Integer
 -> Maybe Integer
 -> Maybe Integer
 -> BucketCountByEncryptionType)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Integer
      -> Maybe Integer -> Maybe Integer -> BucketCountByEncryptionType)
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
"unknown")
            Parser
  (Maybe Integer
   -> Maybe Integer -> Maybe Integer -> BucketCountByEncryptionType)
-> Parser (Maybe Integer)
-> Parser
     (Maybe Integer -> Maybe Integer -> BucketCountByEncryptionType)
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
"s3Managed")
            Parser
  (Maybe Integer -> Maybe Integer -> BucketCountByEncryptionType)
-> Parser (Maybe Integer)
-> Parser (Maybe Integer -> BucketCountByEncryptionType)
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
"unencrypted")
            Parser (Maybe Integer -> BucketCountByEncryptionType)
-> Parser (Maybe Integer) -> Parser BucketCountByEncryptionType
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
"kmsManaged")
      )

instance Prelude.Hashable BucketCountByEncryptionType

instance Prelude.NFData BucketCountByEncryptionType