{-# 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.BucketCountPolicyAllowsUnencryptedObjectUploads
-- 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.BucketCountPolicyAllowsUnencryptedObjectUploads 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 whose bucket
-- policies do or don\'t require server-side encryption of objects when
-- objects are uploaded to the buckets.
--
-- /See:/ 'newBucketCountPolicyAllowsUnencryptedObjectUploads' smart constructor.
data BucketCountPolicyAllowsUnencryptedObjectUploads = BucketCountPolicyAllowsUnencryptedObjectUploads'
  { -- | The total number of buckets whose bucket policies require server-side
    -- encryption of new objects. PutObject requests for these buckets must
    -- include the x-amz-server-side-encryption header and the value for that
    -- header must be AES256 or aws:kms.
    BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
deniesUnencryptedObjectUploads :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets that Amazon Macie wasn\'t able to evaluate
    -- server-side encryption requirements for. Macie can\'t determine whether
    -- the bucket policies for these buckets require server-side encryption of
    -- new objects.
    BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
unknown :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets that don\'t have a bucket policy or have a
    -- bucket policy that doesn\'t require server-side encryption of new
    -- objects. If a bucket policy exists, the policy doesn\'t require
    -- PutObject requests to include the x-amz-server-side-encryption header
    -- and it doesn\'t require the value for that header to be AES256 or
    -- aws:kms.
    BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
allowsUnencryptedObjectUploads :: Prelude.Maybe Prelude.Integer
  }
  deriving (BucketCountPolicyAllowsUnencryptedObjectUploads
-> BucketCountPolicyAllowsUnencryptedObjectUploads -> Bool
(BucketCountPolicyAllowsUnencryptedObjectUploads
 -> BucketCountPolicyAllowsUnencryptedObjectUploads -> Bool)
-> (BucketCountPolicyAllowsUnencryptedObjectUploads
    -> BucketCountPolicyAllowsUnencryptedObjectUploads -> Bool)
-> Eq BucketCountPolicyAllowsUnencryptedObjectUploads
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BucketCountPolicyAllowsUnencryptedObjectUploads
-> BucketCountPolicyAllowsUnencryptedObjectUploads -> Bool
$c/= :: BucketCountPolicyAllowsUnencryptedObjectUploads
-> BucketCountPolicyAllowsUnencryptedObjectUploads -> Bool
== :: BucketCountPolicyAllowsUnencryptedObjectUploads
-> BucketCountPolicyAllowsUnencryptedObjectUploads -> Bool
$c== :: BucketCountPolicyAllowsUnencryptedObjectUploads
-> BucketCountPolicyAllowsUnencryptedObjectUploads -> Bool
Prelude.Eq, ReadPrec [BucketCountPolicyAllowsUnencryptedObjectUploads]
ReadPrec BucketCountPolicyAllowsUnencryptedObjectUploads
Int -> ReadS BucketCountPolicyAllowsUnencryptedObjectUploads
ReadS [BucketCountPolicyAllowsUnencryptedObjectUploads]
(Int -> ReadS BucketCountPolicyAllowsUnencryptedObjectUploads)
-> ReadS [BucketCountPolicyAllowsUnencryptedObjectUploads]
-> ReadPrec BucketCountPolicyAllowsUnencryptedObjectUploads
-> ReadPrec [BucketCountPolicyAllowsUnencryptedObjectUploads]
-> Read BucketCountPolicyAllowsUnencryptedObjectUploads
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BucketCountPolicyAllowsUnencryptedObjectUploads]
$creadListPrec :: ReadPrec [BucketCountPolicyAllowsUnencryptedObjectUploads]
readPrec :: ReadPrec BucketCountPolicyAllowsUnencryptedObjectUploads
$creadPrec :: ReadPrec BucketCountPolicyAllowsUnencryptedObjectUploads
readList :: ReadS [BucketCountPolicyAllowsUnencryptedObjectUploads]
$creadList :: ReadS [BucketCountPolicyAllowsUnencryptedObjectUploads]
readsPrec :: Int -> ReadS BucketCountPolicyAllowsUnencryptedObjectUploads
$creadsPrec :: Int -> ReadS BucketCountPolicyAllowsUnencryptedObjectUploads
Prelude.Read, Int -> BucketCountPolicyAllowsUnencryptedObjectUploads -> ShowS
[BucketCountPolicyAllowsUnencryptedObjectUploads] -> ShowS
BucketCountPolicyAllowsUnencryptedObjectUploads -> String
(Int -> BucketCountPolicyAllowsUnencryptedObjectUploads -> ShowS)
-> (BucketCountPolicyAllowsUnencryptedObjectUploads -> String)
-> ([BucketCountPolicyAllowsUnencryptedObjectUploads] -> ShowS)
-> Show BucketCountPolicyAllowsUnencryptedObjectUploads
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BucketCountPolicyAllowsUnencryptedObjectUploads] -> ShowS
$cshowList :: [BucketCountPolicyAllowsUnencryptedObjectUploads] -> ShowS
show :: BucketCountPolicyAllowsUnencryptedObjectUploads -> String
$cshow :: BucketCountPolicyAllowsUnencryptedObjectUploads -> String
showsPrec :: Int -> BucketCountPolicyAllowsUnencryptedObjectUploads -> ShowS
$cshowsPrec :: Int -> BucketCountPolicyAllowsUnencryptedObjectUploads -> ShowS
Prelude.Show, (forall x.
 BucketCountPolicyAllowsUnencryptedObjectUploads
 -> Rep BucketCountPolicyAllowsUnencryptedObjectUploads x)
-> (forall x.
    Rep BucketCountPolicyAllowsUnencryptedObjectUploads x
    -> BucketCountPolicyAllowsUnencryptedObjectUploads)
-> Generic BucketCountPolicyAllowsUnencryptedObjectUploads
forall x.
Rep BucketCountPolicyAllowsUnencryptedObjectUploads x
-> BucketCountPolicyAllowsUnencryptedObjectUploads
forall x.
BucketCountPolicyAllowsUnencryptedObjectUploads
-> Rep BucketCountPolicyAllowsUnencryptedObjectUploads x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BucketCountPolicyAllowsUnencryptedObjectUploads x
-> BucketCountPolicyAllowsUnencryptedObjectUploads
$cfrom :: forall x.
BucketCountPolicyAllowsUnencryptedObjectUploads
-> Rep BucketCountPolicyAllowsUnencryptedObjectUploads x
Prelude.Generic)

-- |
-- Create a value of 'BucketCountPolicyAllowsUnencryptedObjectUploads' 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:
--
-- 'deniesUnencryptedObjectUploads', 'bucketCountPolicyAllowsUnencryptedObjectUploads_deniesUnencryptedObjectUploads' - The total number of buckets whose bucket policies require server-side
-- encryption of new objects. PutObject requests for these buckets must
-- include the x-amz-server-side-encryption header and the value for that
-- header must be AES256 or aws:kms.
--
-- 'unknown', 'bucketCountPolicyAllowsUnencryptedObjectUploads_unknown' - The total number of buckets that Amazon Macie wasn\'t able to evaluate
-- server-side encryption requirements for. Macie can\'t determine whether
-- the bucket policies for these buckets require server-side encryption of
-- new objects.
--
-- 'allowsUnencryptedObjectUploads', 'bucketCountPolicyAllowsUnencryptedObjectUploads_allowsUnencryptedObjectUploads' - The total number of buckets that don\'t have a bucket policy or have a
-- bucket policy that doesn\'t require server-side encryption of new
-- objects. If a bucket policy exists, the policy doesn\'t require
-- PutObject requests to include the x-amz-server-side-encryption header
-- and it doesn\'t require the value for that header to be AES256 or
-- aws:kms.
newBucketCountPolicyAllowsUnencryptedObjectUploads ::
  BucketCountPolicyAllowsUnencryptedObjectUploads
newBucketCountPolicyAllowsUnencryptedObjectUploads :: BucketCountPolicyAllowsUnencryptedObjectUploads
newBucketCountPolicyAllowsUnencryptedObjectUploads =
  BucketCountPolicyAllowsUnencryptedObjectUploads' :: Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> BucketCountPolicyAllowsUnencryptedObjectUploads
BucketCountPolicyAllowsUnencryptedObjectUploads'
    { $sel:deniesUnencryptedObjectUploads:BucketCountPolicyAllowsUnencryptedObjectUploads' :: Maybe Integer
deniesUnencryptedObjectUploads =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:unknown:BucketCountPolicyAllowsUnencryptedObjectUploads' :: Maybe Integer
unknown = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
      $sel:allowsUnencryptedObjectUploads:BucketCountPolicyAllowsUnencryptedObjectUploads' :: Maybe Integer
allowsUnencryptedObjectUploads =
        Maybe Integer
forall a. Maybe a
Prelude.Nothing
    }

-- | The total number of buckets whose bucket policies require server-side
-- encryption of new objects. PutObject requests for these buckets must
-- include the x-amz-server-side-encryption header and the value for that
-- header must be AES256 or aws:kms.
bucketCountPolicyAllowsUnencryptedObjectUploads_deniesUnencryptedObjectUploads :: Lens.Lens' BucketCountPolicyAllowsUnencryptedObjectUploads (Prelude.Maybe Prelude.Integer)
bucketCountPolicyAllowsUnencryptedObjectUploads_deniesUnencryptedObjectUploads :: (Maybe Integer -> f (Maybe Integer))
-> BucketCountPolicyAllowsUnencryptedObjectUploads
-> f BucketCountPolicyAllowsUnencryptedObjectUploads
bucketCountPolicyAllowsUnencryptedObjectUploads_deniesUnencryptedObjectUploads = (BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer)
-> (BucketCountPolicyAllowsUnencryptedObjectUploads
    -> Maybe Integer
    -> BucketCountPolicyAllowsUnencryptedObjectUploads)
-> Lens
     BucketCountPolicyAllowsUnencryptedObjectUploads
     BucketCountPolicyAllowsUnencryptedObjectUploads
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCountPolicyAllowsUnencryptedObjectUploads' {Maybe Integer
deniesUnencryptedObjectUploads :: Maybe Integer
$sel:deniesUnencryptedObjectUploads:BucketCountPolicyAllowsUnencryptedObjectUploads' :: BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
deniesUnencryptedObjectUploads} -> Maybe Integer
deniesUnencryptedObjectUploads) (\s :: BucketCountPolicyAllowsUnencryptedObjectUploads
s@BucketCountPolicyAllowsUnencryptedObjectUploads' {} Maybe Integer
a -> BucketCountPolicyAllowsUnencryptedObjectUploads
s {$sel:deniesUnencryptedObjectUploads:BucketCountPolicyAllowsUnencryptedObjectUploads' :: Maybe Integer
deniesUnencryptedObjectUploads = Maybe Integer
a} :: BucketCountPolicyAllowsUnencryptedObjectUploads)

-- | The total number of buckets that Amazon Macie wasn\'t able to evaluate
-- server-side encryption requirements for. Macie can\'t determine whether
-- the bucket policies for these buckets require server-side encryption of
-- new objects.
bucketCountPolicyAllowsUnencryptedObjectUploads_unknown :: Lens.Lens' BucketCountPolicyAllowsUnencryptedObjectUploads (Prelude.Maybe Prelude.Integer)
bucketCountPolicyAllowsUnencryptedObjectUploads_unknown :: (Maybe Integer -> f (Maybe Integer))
-> BucketCountPolicyAllowsUnencryptedObjectUploads
-> f BucketCountPolicyAllowsUnencryptedObjectUploads
bucketCountPolicyAllowsUnencryptedObjectUploads_unknown = (BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer)
-> (BucketCountPolicyAllowsUnencryptedObjectUploads
    -> Maybe Integer
    -> BucketCountPolicyAllowsUnencryptedObjectUploads)
-> Lens
     BucketCountPolicyAllowsUnencryptedObjectUploads
     BucketCountPolicyAllowsUnencryptedObjectUploads
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCountPolicyAllowsUnencryptedObjectUploads' {Maybe Integer
unknown :: Maybe Integer
$sel:unknown:BucketCountPolicyAllowsUnencryptedObjectUploads' :: BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
unknown} -> Maybe Integer
unknown) (\s :: BucketCountPolicyAllowsUnencryptedObjectUploads
s@BucketCountPolicyAllowsUnencryptedObjectUploads' {} Maybe Integer
a -> BucketCountPolicyAllowsUnencryptedObjectUploads
s {$sel:unknown:BucketCountPolicyAllowsUnencryptedObjectUploads' :: Maybe Integer
unknown = Maybe Integer
a} :: BucketCountPolicyAllowsUnencryptedObjectUploads)

-- | The total number of buckets that don\'t have a bucket policy or have a
-- bucket policy that doesn\'t require server-side encryption of new
-- objects. If a bucket policy exists, the policy doesn\'t require
-- PutObject requests to include the x-amz-server-side-encryption header
-- and it doesn\'t require the value for that header to be AES256 or
-- aws:kms.
bucketCountPolicyAllowsUnencryptedObjectUploads_allowsUnencryptedObjectUploads :: Lens.Lens' BucketCountPolicyAllowsUnencryptedObjectUploads (Prelude.Maybe Prelude.Integer)
bucketCountPolicyAllowsUnencryptedObjectUploads_allowsUnencryptedObjectUploads :: (Maybe Integer -> f (Maybe Integer))
-> BucketCountPolicyAllowsUnencryptedObjectUploads
-> f BucketCountPolicyAllowsUnencryptedObjectUploads
bucketCountPolicyAllowsUnencryptedObjectUploads_allowsUnencryptedObjectUploads = (BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer)
-> (BucketCountPolicyAllowsUnencryptedObjectUploads
    -> Maybe Integer
    -> BucketCountPolicyAllowsUnencryptedObjectUploads)
-> Lens
     BucketCountPolicyAllowsUnencryptedObjectUploads
     BucketCountPolicyAllowsUnencryptedObjectUploads
     (Maybe Integer)
     (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketCountPolicyAllowsUnencryptedObjectUploads' {Maybe Integer
allowsUnencryptedObjectUploads :: Maybe Integer
$sel:allowsUnencryptedObjectUploads:BucketCountPolicyAllowsUnencryptedObjectUploads' :: BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
allowsUnencryptedObjectUploads} -> Maybe Integer
allowsUnencryptedObjectUploads) (\s :: BucketCountPolicyAllowsUnencryptedObjectUploads
s@BucketCountPolicyAllowsUnencryptedObjectUploads' {} Maybe Integer
a -> BucketCountPolicyAllowsUnencryptedObjectUploads
s {$sel:allowsUnencryptedObjectUploads:BucketCountPolicyAllowsUnencryptedObjectUploads' :: Maybe Integer
allowsUnencryptedObjectUploads = Maybe Integer
a} :: BucketCountPolicyAllowsUnencryptedObjectUploads)

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

instance
  Prelude.Hashable
    BucketCountPolicyAllowsUnencryptedObjectUploads

instance
  Prelude.NFData
    BucketCountPolicyAllowsUnencryptedObjectUploads