{-# 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-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.ObjectCountByEncryptionType 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 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 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,
    -- | 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 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 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
  }
  deriving (ObjectCountByEncryptionType -> ObjectCountByEncryptionType -> Bool
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]
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
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.
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:
--
-- '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).
--
-- '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).
--
-- '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.
--
-- '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.
newObjectCountByEncryptionType ::
  ObjectCountByEncryptionType
newObjectCountByEncryptionType :: ObjectCountByEncryptionType
newObjectCountByEncryptionType =
  ObjectCountByEncryptionType'
    { $sel:customerManaged:ObjectCountByEncryptionType' :: Maybe Integer
customerManaged =
        forall a. Maybe a
Prelude.Nothing,
      $sel:kmsManaged:ObjectCountByEncryptionType' :: Maybe Integer
kmsManaged = forall a. Maybe a
Prelude.Nothing,
      $sel:s3Managed:ObjectCountByEncryptionType' :: Maybe Integer
s3Managed = forall a. Maybe a
Prelude.Nothing,
      $sel:unencrypted:ObjectCountByEncryptionType' :: Maybe Integer
unencrypted = forall a. Maybe a
Prelude.Nothing,
      $sel:unknown:ObjectCountByEncryptionType' :: Maybe Integer
unknown = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' ObjectCountByEncryptionType (Maybe Integer)
objectCountByEncryptionType_customerManaged = 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)

-- | 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 :: Lens' ObjectCountByEncryptionType (Maybe Integer)
objectCountByEncryptionType_kmsManaged = 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 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 :: Lens' ObjectCountByEncryptionType (Maybe Integer)
objectCountByEncryptionType_s3Managed = 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 :: Lens' ObjectCountByEncryptionType (Maybe Integer)
objectCountByEncryptionType_unencrypted = 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 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 :: Lens' ObjectCountByEncryptionType (Maybe Integer)
objectCountByEncryptionType_unknown = 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)

instance Data.FromJSON ObjectCountByEncryptionType where
  parseJSON :: Value -> Parser ObjectCountByEncryptionType
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ObjectCountByEncryptionType"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> ObjectCountByEncryptionType
ObjectCountByEncryptionType'
            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
"customerManaged")
            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
"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 ObjectCountByEncryptionType where
  hashWithSalt :: Int -> ObjectCountByEncryptionType -> Int
hashWithSalt Int
_salt ObjectCountByEncryptionType' {Maybe Integer
unknown :: Maybe Integer
unencrypted :: Maybe Integer
s3Managed :: Maybe Integer
kmsManaged :: Maybe Integer
customerManaged :: Maybe Integer
$sel:unknown:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
$sel:unencrypted:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
$sel:s3Managed:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
$sel:kmsManaged:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
$sel:customerManaged:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
customerManaged
      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 ObjectCountByEncryptionType where
  rnf :: ObjectCountByEncryptionType -> ()
rnf ObjectCountByEncryptionType' {Maybe Integer
unknown :: Maybe Integer
unencrypted :: Maybe Integer
s3Managed :: Maybe Integer
kmsManaged :: Maybe Integer
customerManaged :: Maybe Integer
$sel:unknown:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
$sel:unencrypted:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
$sel:s3Managed:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
$sel:kmsManaged:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
$sel:customerManaged:ObjectCountByEncryptionType' :: ObjectCountByEncryptionType -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
customerManaged
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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