{-# 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-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.BucketCountPolicyAllowsUnencryptedObjectUploads 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 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 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 a valid server-side encryption header: the
    -- x-amz-server-side-encryption header with a value of AES256 or aws:kms,
    -- or the x-amz-server-side-encryption-customer-algorithm header with a
    -- value of AES256.
    BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
allowsUnencryptedObjectUploads :: Prelude.Maybe Prelude.Integer,
    -- | The total number of buckets whose bucket policies require server-side
    -- encryption of new objects. PutObject requests for these buckets must
    -- include a valid server-side encryption header: the
    -- x-amz-server-side-encryption header with a value of AES256 or aws:kms,
    -- or the x-amz-server-side-encryption-customer-algorithm header with a
    -- value of AES256.
    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
  }
  deriving (BucketCountPolicyAllowsUnencryptedObjectUploads
-> BucketCountPolicyAllowsUnencryptedObjectUploads -> Bool
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]
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
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.
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:
--
-- '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 a valid server-side encryption header: the
-- x-amz-server-side-encryption header with a value of AES256 or aws:kms,
-- or the x-amz-server-side-encryption-customer-algorithm header with a
-- value of AES256.
--
-- '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 a valid server-side encryption header: the
-- x-amz-server-side-encryption header with a value of AES256 or aws:kms,
-- or the x-amz-server-side-encryption-customer-algorithm header with a
-- value of AES256.
--
-- '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.
newBucketCountPolicyAllowsUnencryptedObjectUploads ::
  BucketCountPolicyAllowsUnencryptedObjectUploads
newBucketCountPolicyAllowsUnencryptedObjectUploads :: BucketCountPolicyAllowsUnencryptedObjectUploads
newBucketCountPolicyAllowsUnencryptedObjectUploads =
  BucketCountPolicyAllowsUnencryptedObjectUploads'
    { $sel:allowsUnencryptedObjectUploads:BucketCountPolicyAllowsUnencryptedObjectUploads' :: Maybe Integer
allowsUnencryptedObjectUploads =
        forall a. Maybe a
Prelude.Nothing,
      $sel:deniesUnencryptedObjectUploads:BucketCountPolicyAllowsUnencryptedObjectUploads' :: Maybe Integer
deniesUnencryptedObjectUploads =
        forall a. Maybe a
Prelude.Nothing,
      $sel:unknown:BucketCountPolicyAllowsUnencryptedObjectUploads' :: Maybe Integer
unknown = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 a valid server-side encryption header: the
-- x-amz-server-side-encryption header with a value of AES256 or aws:kms,
-- or the x-amz-server-side-encryption-customer-algorithm header with a
-- value of AES256.
bucketCountPolicyAllowsUnencryptedObjectUploads_allowsUnencryptedObjectUploads :: Lens.Lens' BucketCountPolicyAllowsUnencryptedObjectUploads (Prelude.Maybe Prelude.Integer)
bucketCountPolicyAllowsUnencryptedObjectUploads_allowsUnencryptedObjectUploads :: Lens'
  BucketCountPolicyAllowsUnencryptedObjectUploads (Maybe Integer)
bucketCountPolicyAllowsUnencryptedObjectUploads_allowsUnencryptedObjectUploads = 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)

-- | The total number of buckets whose bucket policies require server-side
-- encryption of new objects. PutObject requests for these buckets must
-- include a valid server-side encryption header: the
-- x-amz-server-side-encryption header with a value of AES256 or aws:kms,
-- or the x-amz-server-side-encryption-customer-algorithm header with a
-- value of AES256.
bucketCountPolicyAllowsUnencryptedObjectUploads_deniesUnencryptedObjectUploads :: Lens.Lens' BucketCountPolicyAllowsUnencryptedObjectUploads (Prelude.Maybe Prelude.Integer)
bucketCountPolicyAllowsUnencryptedObjectUploads_deniesUnencryptedObjectUploads :: Lens'
  BucketCountPolicyAllowsUnencryptedObjectUploads (Maybe Integer)
bucketCountPolicyAllowsUnencryptedObjectUploads_deniesUnencryptedObjectUploads = 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 :: Lens'
  BucketCountPolicyAllowsUnencryptedObjectUploads (Maybe Integer)
bucketCountPolicyAllowsUnencryptedObjectUploads_unknown = 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)

instance
  Data.FromJSON
    BucketCountPolicyAllowsUnencryptedObjectUploads
  where
  parseJSON :: Value -> Parser BucketCountPolicyAllowsUnencryptedObjectUploads
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"BucketCountPolicyAllowsUnencryptedObjectUploads"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> BucketCountPolicyAllowsUnencryptedObjectUploads
BucketCountPolicyAllowsUnencryptedObjectUploads'
            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
"allowsUnencryptedObjectUploads")
            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
"deniesUnencryptedObjectUploads")
            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
    BucketCountPolicyAllowsUnencryptedObjectUploads
  where
  hashWithSalt :: Int -> BucketCountPolicyAllowsUnencryptedObjectUploads -> Int
hashWithSalt
    Int
_salt
    BucketCountPolicyAllowsUnencryptedObjectUploads' {Maybe Integer
unknown :: Maybe Integer
deniesUnencryptedObjectUploads :: Maybe Integer
allowsUnencryptedObjectUploads :: Maybe Integer
$sel:unknown:BucketCountPolicyAllowsUnencryptedObjectUploads' :: BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
$sel:deniesUnencryptedObjectUploads:BucketCountPolicyAllowsUnencryptedObjectUploads' :: BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
$sel:allowsUnencryptedObjectUploads:BucketCountPolicyAllowsUnencryptedObjectUploads' :: BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
allowsUnencryptedObjectUploads
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
deniesUnencryptedObjectUploads
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
unknown

instance
  Prelude.NFData
    BucketCountPolicyAllowsUnencryptedObjectUploads
  where
  rnf :: BucketCountPolicyAllowsUnencryptedObjectUploads -> ()
rnf
    BucketCountPolicyAllowsUnencryptedObjectUploads' {Maybe Integer
unknown :: Maybe Integer
deniesUnencryptedObjectUploads :: Maybe Integer
allowsUnencryptedObjectUploads :: Maybe Integer
$sel:unknown:BucketCountPolicyAllowsUnencryptedObjectUploads' :: BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
$sel:deniesUnencryptedObjectUploads:BucketCountPolicyAllowsUnencryptedObjectUploads' :: BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
$sel:allowsUnencryptedObjectUploads:BucketCountPolicyAllowsUnencryptedObjectUploads' :: BucketCountPolicyAllowsUnencryptedObjectUploads -> Maybe Integer
..} =
      forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
allowsUnencryptedObjectUploads
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
deniesUnencryptedObjectUploads
        seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
unknown