{-# 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.ObjectCountByEncryptionType
-- 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.ObjectCountByEncryptionType 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 objects that are in an S3
-- bucket and use certain types of server-side encryption, use client-side
-- encryption, or aren\'t encrypted.
--
-- /See:/ 'newObjectCountByEncryptionType' smart constructor.
data ObjectCountByEncryptionType = ObjectCountByEncryptionType'
  { -- | The total number of objects that Amazon Macie doesn\'t have current
    -- encryption metadata for. Macie can\'t provide current data about the
    -- encryption settings for these objects.
    ObjectCountByEncryptionType -> Maybe Integer
unknown :: Prelude.Maybe Prelude.Integer,
    -- | The total number of objects that are encrypted with an Amazon S3 managed
    -- key. The objects use Amazon S3 managed encryption (SSE-S3).
    ObjectCountByEncryptionType -> Maybe Integer
s3Managed :: Prelude.Maybe Prelude.Integer,
    -- | The total number of objects that aren\'t encrypted or use client-side
    -- encryption.
    ObjectCountByEncryptionType -> Maybe Integer
unencrypted :: Prelude.Maybe Prelude.Integer,
    -- | The total number of objects that are encrypted with an KMS key, either
    -- an Amazon Web Services managed key or a customer managed key. The
    -- objects use KMS encryption (SSE-KMS).
    ObjectCountByEncryptionType -> Maybe Integer
kmsManaged :: Prelude.Maybe Prelude.Integer,
    -- | The total number of objects that are encrypted with a customer-provided
    -- key. The objects use customer-provided server-side encryption (SSE-C).
    ObjectCountByEncryptionType -> Maybe Integer
customerManaged :: Prelude.Maybe Prelude.Integer
  }
  deriving (ObjectCountByEncryptionType -> ObjectCountByEncryptionType -> Bool
(ObjectCountByEncryptionType
 -> ObjectCountByEncryptionType -> Bool)
-> (ObjectCountByEncryptionType
    -> ObjectCountByEncryptionType -> Bool)
-> Eq ObjectCountByEncryptionType
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ObjectCountByEncryptionType -> ObjectCountByEncryptionType -> Bool
$c/= :: ObjectCountByEncryptionType -> ObjectCountByEncryptionType -> Bool
== :: ObjectCountByEncryptionType -> ObjectCountByEncryptionType -> Bool
$c== :: ObjectCountByEncryptionType -> ObjectCountByEncryptionType -> Bool
Prelude.Eq, ReadPrec [ObjectCountByEncryptionType]
ReadPrec ObjectCountByEncryptionType
Int -> ReadS ObjectCountByEncryptionType
ReadS [ObjectCountByEncryptionType]
(Int -> ReadS ObjectCountByEncryptionType)
-> ReadS [ObjectCountByEncryptionType]
-> ReadPrec ObjectCountByEncryptionType
-> ReadPrec [ObjectCountByEncryptionType]
-> Read ObjectCountByEncryptionType
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ObjectCountByEncryptionType]
$creadListPrec :: ReadPrec [ObjectCountByEncryptionType]
readPrec :: ReadPrec ObjectCountByEncryptionType
$creadPrec :: ReadPrec ObjectCountByEncryptionType
readList :: ReadS [ObjectCountByEncryptionType]
$creadList :: ReadS [ObjectCountByEncryptionType]
readsPrec :: Int -> ReadS ObjectCountByEncryptionType
$creadsPrec :: Int -> ReadS ObjectCountByEncryptionType
Prelude.Read, Int -> ObjectCountByEncryptionType -> ShowS
[ObjectCountByEncryptionType] -> ShowS
ObjectCountByEncryptionType -> String
(Int -> ObjectCountByEncryptionType -> ShowS)
-> (ObjectCountByEncryptionType -> String)
-> ([ObjectCountByEncryptionType] -> ShowS)
-> Show ObjectCountByEncryptionType
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ObjectCountByEncryptionType] -> ShowS
$cshowList :: [ObjectCountByEncryptionType] -> ShowS
show :: ObjectCountByEncryptionType -> String
$cshow :: ObjectCountByEncryptionType -> String
showsPrec :: Int -> ObjectCountByEncryptionType -> ShowS
$cshowsPrec :: Int -> ObjectCountByEncryptionType -> ShowS
Prelude.Show, (forall x.
 ObjectCountByEncryptionType -> Rep ObjectCountByEncryptionType x)
-> (forall x.
    Rep ObjectCountByEncryptionType x -> ObjectCountByEncryptionType)
-> Generic ObjectCountByEncryptionType
forall x.
Rep ObjectCountByEncryptionType x -> ObjectCountByEncryptionType
forall x.
ObjectCountByEncryptionType -> Rep ObjectCountByEncryptionType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ObjectCountByEncryptionType x -> ObjectCountByEncryptionType
$cfrom :: forall x.
ObjectCountByEncryptionType -> Rep ObjectCountByEncryptionType x
Prelude.Generic)

-- |
-- Create a value of 'ObjectCountByEncryptionType' 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', 'objectCountByEncryptionType_unknown' - The total number of objects that Amazon Macie doesn\'t have current
-- encryption metadata for. Macie can\'t provide current data about the
-- encryption settings for these objects.
--
-- 's3Managed', 'objectCountByEncryptionType_s3Managed' - The total number of objects that are encrypted with an Amazon S3 managed
-- key. The objects use Amazon S3 managed encryption (SSE-S3).
--
-- 'unencrypted', 'objectCountByEncryptionType_unencrypted' - The total number of objects that aren\'t encrypted or use client-side
-- encryption.
--
-- 'kmsManaged', 'objectCountByEncryptionType_kmsManaged' - The total number of objects that are encrypted with an KMS key, either
-- an Amazon Web Services managed key or a customer managed key. The
-- objects use KMS encryption (SSE-KMS).
--
-- 'customerManaged', 'objectCountByEncryptionType_customerManaged' - The total number of objects that are encrypted with a customer-provided
-- key. The objects use customer-provided server-side encryption (SSE-C).
newObjectCountByEncryptionType ::
  ObjectCountByEncryptionType
newObjectCountByEncryptionType :: ObjectCountByEncryptionType
newObjectCountByEncryptionType =
  ObjectCountByEncryptionType' :: Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> ObjectCountByEncryptionType
ObjectCountByEncryptionType'
    { $sel:unknown:ObjectCountByEncryptionType' :: Maybe Integer
unknown =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:s3Managed:ObjectCountByEncryptionType' :: Maybe Integer
s3Managed = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:unencrypted:ObjectCountByEncryptionType' :: Maybe Integer
unencrypted = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:kmsManaged:ObjectCountByEncryptionType' :: Maybe Integer
kmsManaged = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:customerManaged:ObjectCountByEncryptionType' :: Maybe Integer
customerManaged = Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

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

-- | The total number of objects that are encrypted with an Amazon S3 managed
-- key. The objects use Amazon S3 managed encryption (SSE-S3).
objectCountByEncryptionType_s3Managed :: Lens.Lens' ObjectCountByEncryptionType (Prelude.Maybe Prelude.Integer)
objectCountByEncryptionType_s3Managed :: (Maybe Integer -> f (Maybe Integer))
-> ObjectCountByEncryptionType -> f ObjectCountByEncryptionType
objectCountByEncryptionType_s3Managed = (ObjectCountByEncryptionType -> Maybe Integer)
-> (ObjectCountByEncryptionType
    -> Maybe Integer -> ObjectCountByEncryptionType)
-> Lens
     ObjectCountByEncryptionType
     ObjectCountByEncryptionType
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectCountByEncryptionType' {Maybe Integer
s3Managed :: Maybe Integer
$sel:s3Managed:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
s3Managed} -> Maybe Integer
s3Managed) (\s :: ObjectCountByEncryptionType
s@ObjectCountByEncryptionType' {} Maybe Integer
a -> ObjectCountByEncryptionType
s {$sel:s3Managed:ObjectCountByEncryptionType' :: Maybe Integer
s3Managed = Maybe Integer
a} :: ObjectCountByEncryptionType)

-- | The total number of objects that aren\'t encrypted or use client-side
-- encryption.
objectCountByEncryptionType_unencrypted :: Lens.Lens' ObjectCountByEncryptionType (Prelude.Maybe Prelude.Integer)
objectCountByEncryptionType_unencrypted :: (Maybe Integer -> f (Maybe Integer))
-> ObjectCountByEncryptionType -> f ObjectCountByEncryptionType
objectCountByEncryptionType_unencrypted = (ObjectCountByEncryptionType -> Maybe Integer)
-> (ObjectCountByEncryptionType
    -> Maybe Integer -> ObjectCountByEncryptionType)
-> Lens
     ObjectCountByEncryptionType
     ObjectCountByEncryptionType
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectCountByEncryptionType' {Maybe Integer
unencrypted :: Maybe Integer
$sel:unencrypted:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
unencrypted} -> Maybe Integer
unencrypted) (\s :: ObjectCountByEncryptionType
s@ObjectCountByEncryptionType' {} Maybe Integer
a -> ObjectCountByEncryptionType
s {$sel:unencrypted:ObjectCountByEncryptionType' :: Maybe Integer
unencrypted = Maybe Integer
a} :: ObjectCountByEncryptionType)

-- | The total number of objects that are encrypted with an KMS key, either
-- an Amazon Web Services managed key or a customer managed key. The
-- objects use KMS encryption (SSE-KMS).
objectCountByEncryptionType_kmsManaged :: Lens.Lens' ObjectCountByEncryptionType (Prelude.Maybe Prelude.Integer)
objectCountByEncryptionType_kmsManaged :: (Maybe Integer -> f (Maybe Integer))
-> ObjectCountByEncryptionType -> f ObjectCountByEncryptionType
objectCountByEncryptionType_kmsManaged = (ObjectCountByEncryptionType -> Maybe Integer)
-> (ObjectCountByEncryptionType
    -> Maybe Integer -> ObjectCountByEncryptionType)
-> Lens
     ObjectCountByEncryptionType
     ObjectCountByEncryptionType
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectCountByEncryptionType' {Maybe Integer
kmsManaged :: Maybe Integer
$sel:kmsManaged:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
kmsManaged} -> Maybe Integer
kmsManaged) (\s :: ObjectCountByEncryptionType
s@ObjectCountByEncryptionType' {} Maybe Integer
a -> ObjectCountByEncryptionType
s {$sel:kmsManaged:ObjectCountByEncryptionType' :: Maybe Integer
kmsManaged = Maybe Integer
a} :: ObjectCountByEncryptionType)

-- | The total number of objects that are encrypted with a customer-provided
-- key. The objects use customer-provided server-side encryption (SSE-C).
objectCountByEncryptionType_customerManaged :: Lens.Lens' ObjectCountByEncryptionType (Prelude.Maybe Prelude.Integer)
objectCountByEncryptionType_customerManaged :: (Maybe Integer -> f (Maybe Integer))
-> ObjectCountByEncryptionType -> f ObjectCountByEncryptionType
objectCountByEncryptionType_customerManaged = (ObjectCountByEncryptionType -> Maybe Integer)
-> (ObjectCountByEncryptionType
    -> Maybe Integer -> ObjectCountByEncryptionType)
-> Lens
     ObjectCountByEncryptionType
     ObjectCountByEncryptionType
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ObjectCountByEncryptionType' {Maybe Integer
customerManaged :: Maybe Integer
$sel:customerManaged:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
customerManaged} -> Maybe Integer
customerManaged) (\s :: ObjectCountByEncryptionType
s@ObjectCountByEncryptionType' {} Maybe Integer
a -> ObjectCountByEncryptionType
s {$sel:customerManaged:ObjectCountByEncryptionType' :: Maybe Integer
customerManaged = Maybe Integer
a} :: ObjectCountByEncryptionType)

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

instance Prelude.Hashable ObjectCountByEncryptionType

instance Prelude.NFData ObjectCountByEncryptionType