{-# 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.AccessAnalyzer.Types.S3BucketConfiguration
-- 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.AccessAnalyzer.Types.S3BucketConfiguration where

import Amazonka.AccessAnalyzer.Types.S3AccessPointConfiguration
import Amazonka.AccessAnalyzer.Types.S3BucketAclGrantConfiguration
import Amazonka.AccessAnalyzer.Types.S3PublicAccessBlockConfiguration
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Proposed access control configuration for an Amazon S3 bucket. You can
-- propose a configuration for a new Amazon S3 bucket or an existing Amazon
-- S3 bucket that you own by specifying the Amazon S3 bucket policy, bucket
-- ACLs, bucket BPA settings, Amazon S3 access points, and multi-region
-- access points attached to the bucket. If the configuration is for an
-- existing Amazon S3 bucket and you do not specify the Amazon S3 bucket
-- policy, the access preview uses the existing policy attached to the
-- bucket. If the access preview is for a new resource and you do not
-- specify the Amazon S3 bucket policy, the access preview assumes a bucket
-- without a policy. To propose deletion of an existing bucket policy, you
-- can specify an empty string. For more information about bucket policy
-- limits, see
-- <https://docs.aws.amazon.com/AmazonS3/latest/dev/example-bucket-policies.html Bucket Policy Examples>.
--
-- /See:/ 'newS3BucketConfiguration' smart constructor.
data S3BucketConfiguration = S3BucketConfiguration'
  { -- | The configuration of Amazon S3 access points or multi-region access
    -- points for the bucket. You can propose up to 10 new access points per
    -- bucket.
    S3BucketConfiguration
-> Maybe (HashMap Text S3AccessPointConfiguration)
accessPoints :: Prelude.Maybe (Prelude.HashMap Prelude.Text S3AccessPointConfiguration),
    -- | The proposed block public access configuration for the Amazon S3 bucket.
    S3BucketConfiguration -> Maybe S3PublicAccessBlockConfiguration
bucketPublicAccessBlock :: Prelude.Maybe S3PublicAccessBlockConfiguration,
    -- | The proposed list of ACL grants for the Amazon S3 bucket. You can
    -- propose up to 100 ACL grants per bucket. If the proposed grant
    -- configuration is for an existing bucket, the access preview uses the
    -- proposed list of grant configurations in place of the existing grants.
    -- Otherwise, the access preview uses the existing grants for the bucket.
    S3BucketConfiguration -> Maybe [S3BucketAclGrantConfiguration]
bucketAclGrants :: Prelude.Maybe [S3BucketAclGrantConfiguration],
    -- | The proposed bucket policy for the Amazon S3 bucket.
    S3BucketConfiguration -> Maybe Text
bucketPolicy :: Prelude.Maybe Prelude.Text
  }
  deriving (S3BucketConfiguration -> S3BucketConfiguration -> Bool
(S3BucketConfiguration -> S3BucketConfiguration -> Bool)
-> (S3BucketConfiguration -> S3BucketConfiguration -> Bool)
-> Eq S3BucketConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3BucketConfiguration -> S3BucketConfiguration -> Bool
$c/= :: S3BucketConfiguration -> S3BucketConfiguration -> Bool
== :: S3BucketConfiguration -> S3BucketConfiguration -> Bool
$c== :: S3BucketConfiguration -> S3BucketConfiguration -> Bool
Prelude.Eq, ReadPrec [S3BucketConfiguration]
ReadPrec S3BucketConfiguration
Int -> ReadS S3BucketConfiguration
ReadS [S3BucketConfiguration]
(Int -> ReadS S3BucketConfiguration)
-> ReadS [S3BucketConfiguration]
-> ReadPrec S3BucketConfiguration
-> ReadPrec [S3BucketConfiguration]
-> Read S3BucketConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3BucketConfiguration]
$creadListPrec :: ReadPrec [S3BucketConfiguration]
readPrec :: ReadPrec S3BucketConfiguration
$creadPrec :: ReadPrec S3BucketConfiguration
readList :: ReadS [S3BucketConfiguration]
$creadList :: ReadS [S3BucketConfiguration]
readsPrec :: Int -> ReadS S3BucketConfiguration
$creadsPrec :: Int -> ReadS S3BucketConfiguration
Prelude.Read, Int -> S3BucketConfiguration -> ShowS
[S3BucketConfiguration] -> ShowS
S3BucketConfiguration -> String
(Int -> S3BucketConfiguration -> ShowS)
-> (S3BucketConfiguration -> String)
-> ([S3BucketConfiguration] -> ShowS)
-> Show S3BucketConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3BucketConfiguration] -> ShowS
$cshowList :: [S3BucketConfiguration] -> ShowS
show :: S3BucketConfiguration -> String
$cshow :: S3BucketConfiguration -> String
showsPrec :: Int -> S3BucketConfiguration -> ShowS
$cshowsPrec :: Int -> S3BucketConfiguration -> ShowS
Prelude.Show, (forall x. S3BucketConfiguration -> Rep S3BucketConfiguration x)
-> (forall x. Rep S3BucketConfiguration x -> S3BucketConfiguration)
-> Generic S3BucketConfiguration
forall x. Rep S3BucketConfiguration x -> S3BucketConfiguration
forall x. S3BucketConfiguration -> Rep S3BucketConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep S3BucketConfiguration x -> S3BucketConfiguration
$cfrom :: forall x. S3BucketConfiguration -> Rep S3BucketConfiguration x
Prelude.Generic)

-- |
-- Create a value of 'S3BucketConfiguration' 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:
--
-- 'accessPoints', 's3BucketConfiguration_accessPoints' - The configuration of Amazon S3 access points or multi-region access
-- points for the bucket. You can propose up to 10 new access points per
-- bucket.
--
-- 'bucketPublicAccessBlock', 's3BucketConfiguration_bucketPublicAccessBlock' - The proposed block public access configuration for the Amazon S3 bucket.
--
-- 'bucketAclGrants', 's3BucketConfiguration_bucketAclGrants' - The proposed list of ACL grants for the Amazon S3 bucket. You can
-- propose up to 100 ACL grants per bucket. If the proposed grant
-- configuration is for an existing bucket, the access preview uses the
-- proposed list of grant configurations in place of the existing grants.
-- Otherwise, the access preview uses the existing grants for the bucket.
--
-- 'bucketPolicy', 's3BucketConfiguration_bucketPolicy' - The proposed bucket policy for the Amazon S3 bucket.
newS3BucketConfiguration ::
  S3BucketConfiguration
newS3BucketConfiguration :: S3BucketConfiguration
newS3BucketConfiguration =
  S3BucketConfiguration' :: Maybe (HashMap Text S3AccessPointConfiguration)
-> Maybe S3PublicAccessBlockConfiguration
-> Maybe [S3BucketAclGrantConfiguration]
-> Maybe Text
-> S3BucketConfiguration
S3BucketConfiguration'
    { $sel:accessPoints:S3BucketConfiguration' :: Maybe (HashMap Text S3AccessPointConfiguration)
accessPoints =
        Maybe (HashMap Text S3AccessPointConfiguration)
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketPublicAccessBlock:S3BucketConfiguration' :: Maybe S3PublicAccessBlockConfiguration
bucketPublicAccessBlock = Maybe S3PublicAccessBlockConfiguration
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketAclGrants:S3BucketConfiguration' :: Maybe [S3BucketAclGrantConfiguration]
bucketAclGrants = Maybe [S3BucketAclGrantConfiguration]
forall a. Maybe a
Prelude.Nothing,
      $sel:bucketPolicy:S3BucketConfiguration' :: Maybe Text
bucketPolicy = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The configuration of Amazon S3 access points or multi-region access
-- points for the bucket. You can propose up to 10 new access points per
-- bucket.
s3BucketConfiguration_accessPoints :: Lens.Lens' S3BucketConfiguration (Prelude.Maybe (Prelude.HashMap Prelude.Text S3AccessPointConfiguration))
s3BucketConfiguration_accessPoints :: (Maybe (HashMap Text S3AccessPointConfiguration)
 -> f (Maybe (HashMap Text S3AccessPointConfiguration)))
-> S3BucketConfiguration -> f S3BucketConfiguration
s3BucketConfiguration_accessPoints = (S3BucketConfiguration
 -> Maybe (HashMap Text S3AccessPointConfiguration))
-> (S3BucketConfiguration
    -> Maybe (HashMap Text S3AccessPointConfiguration)
    -> S3BucketConfiguration)
-> Lens
     S3BucketConfiguration
     S3BucketConfiguration
     (Maybe (HashMap Text S3AccessPointConfiguration))
     (Maybe (HashMap Text S3AccessPointConfiguration))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3BucketConfiguration' {Maybe (HashMap Text S3AccessPointConfiguration)
accessPoints :: Maybe (HashMap Text S3AccessPointConfiguration)
$sel:accessPoints:S3BucketConfiguration' :: S3BucketConfiguration
-> Maybe (HashMap Text S3AccessPointConfiguration)
accessPoints} -> Maybe (HashMap Text S3AccessPointConfiguration)
accessPoints) (\s :: S3BucketConfiguration
s@S3BucketConfiguration' {} Maybe (HashMap Text S3AccessPointConfiguration)
a -> S3BucketConfiguration
s {$sel:accessPoints:S3BucketConfiguration' :: Maybe (HashMap Text S3AccessPointConfiguration)
accessPoints = Maybe (HashMap Text S3AccessPointConfiguration)
a} :: S3BucketConfiguration) ((Maybe (HashMap Text S3AccessPointConfiguration)
  -> f (Maybe (HashMap Text S3AccessPointConfiguration)))
 -> S3BucketConfiguration -> f S3BucketConfiguration)
-> ((Maybe (HashMap Text S3AccessPointConfiguration)
     -> f (Maybe (HashMap Text S3AccessPointConfiguration)))
    -> Maybe (HashMap Text S3AccessPointConfiguration)
    -> f (Maybe (HashMap Text S3AccessPointConfiguration)))
-> (Maybe (HashMap Text S3AccessPointConfiguration)
    -> f (Maybe (HashMap Text S3AccessPointConfiguration)))
-> S3BucketConfiguration
-> f S3BucketConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  (HashMap Text S3AccessPointConfiguration)
  (HashMap Text S3AccessPointConfiguration)
  (HashMap Text S3AccessPointConfiguration)
  (HashMap Text S3AccessPointConfiguration)
-> Iso
     (Maybe (HashMap Text S3AccessPointConfiguration))
     (Maybe (HashMap Text S3AccessPointConfiguration))
     (Maybe (HashMap Text S3AccessPointConfiguration))
     (Maybe (HashMap Text S3AccessPointConfiguration))
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  (HashMap Text S3AccessPointConfiguration)
  (HashMap Text S3AccessPointConfiguration)
  (HashMap Text S3AccessPointConfiguration)
  (HashMap Text S3AccessPointConfiguration)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The proposed block public access configuration for the Amazon S3 bucket.
s3BucketConfiguration_bucketPublicAccessBlock :: Lens.Lens' S3BucketConfiguration (Prelude.Maybe S3PublicAccessBlockConfiguration)
s3BucketConfiguration_bucketPublicAccessBlock :: (Maybe S3PublicAccessBlockConfiguration
 -> f (Maybe S3PublicAccessBlockConfiguration))
-> S3BucketConfiguration -> f S3BucketConfiguration
s3BucketConfiguration_bucketPublicAccessBlock = (S3BucketConfiguration -> Maybe S3PublicAccessBlockConfiguration)
-> (S3BucketConfiguration
    -> Maybe S3PublicAccessBlockConfiguration -> S3BucketConfiguration)
-> Lens
     S3BucketConfiguration
     S3BucketConfiguration
     (Maybe S3PublicAccessBlockConfiguration)
     (Maybe S3PublicAccessBlockConfiguration)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3BucketConfiguration' {Maybe S3PublicAccessBlockConfiguration
bucketPublicAccessBlock :: Maybe S3PublicAccessBlockConfiguration
$sel:bucketPublicAccessBlock:S3BucketConfiguration' :: S3BucketConfiguration -> Maybe S3PublicAccessBlockConfiguration
bucketPublicAccessBlock} -> Maybe S3PublicAccessBlockConfiguration
bucketPublicAccessBlock) (\s :: S3BucketConfiguration
s@S3BucketConfiguration' {} Maybe S3PublicAccessBlockConfiguration
a -> S3BucketConfiguration
s {$sel:bucketPublicAccessBlock:S3BucketConfiguration' :: Maybe S3PublicAccessBlockConfiguration
bucketPublicAccessBlock = Maybe S3PublicAccessBlockConfiguration
a} :: S3BucketConfiguration)

-- | The proposed list of ACL grants for the Amazon S3 bucket. You can
-- propose up to 100 ACL grants per bucket. If the proposed grant
-- configuration is for an existing bucket, the access preview uses the
-- proposed list of grant configurations in place of the existing grants.
-- Otherwise, the access preview uses the existing grants for the bucket.
s3BucketConfiguration_bucketAclGrants :: Lens.Lens' S3BucketConfiguration (Prelude.Maybe [S3BucketAclGrantConfiguration])
s3BucketConfiguration_bucketAclGrants :: (Maybe [S3BucketAclGrantConfiguration]
 -> f (Maybe [S3BucketAclGrantConfiguration]))
-> S3BucketConfiguration -> f S3BucketConfiguration
s3BucketConfiguration_bucketAclGrants = (S3BucketConfiguration -> Maybe [S3BucketAclGrantConfiguration])
-> (S3BucketConfiguration
    -> Maybe [S3BucketAclGrantConfiguration] -> S3BucketConfiguration)
-> Lens
     S3BucketConfiguration
     S3BucketConfiguration
     (Maybe [S3BucketAclGrantConfiguration])
     (Maybe [S3BucketAclGrantConfiguration])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3BucketConfiguration' {Maybe [S3BucketAclGrantConfiguration]
bucketAclGrants :: Maybe [S3BucketAclGrantConfiguration]
$sel:bucketAclGrants:S3BucketConfiguration' :: S3BucketConfiguration -> Maybe [S3BucketAclGrantConfiguration]
bucketAclGrants} -> Maybe [S3BucketAclGrantConfiguration]
bucketAclGrants) (\s :: S3BucketConfiguration
s@S3BucketConfiguration' {} Maybe [S3BucketAclGrantConfiguration]
a -> S3BucketConfiguration
s {$sel:bucketAclGrants:S3BucketConfiguration' :: Maybe [S3BucketAclGrantConfiguration]
bucketAclGrants = Maybe [S3BucketAclGrantConfiguration]
a} :: S3BucketConfiguration) ((Maybe [S3BucketAclGrantConfiguration]
  -> f (Maybe [S3BucketAclGrantConfiguration]))
 -> S3BucketConfiguration -> f S3BucketConfiguration)
-> ((Maybe [S3BucketAclGrantConfiguration]
     -> f (Maybe [S3BucketAclGrantConfiguration]))
    -> Maybe [S3BucketAclGrantConfiguration]
    -> f (Maybe [S3BucketAclGrantConfiguration]))
-> (Maybe [S3BucketAclGrantConfiguration]
    -> f (Maybe [S3BucketAclGrantConfiguration]))
-> S3BucketConfiguration
-> f S3BucketConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [S3BucketAclGrantConfiguration]
  [S3BucketAclGrantConfiguration]
  [S3BucketAclGrantConfiguration]
  [S3BucketAclGrantConfiguration]
-> Iso
     (Maybe [S3BucketAclGrantConfiguration])
     (Maybe [S3BucketAclGrantConfiguration])
     (Maybe [S3BucketAclGrantConfiguration])
     (Maybe [S3BucketAclGrantConfiguration])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [S3BucketAclGrantConfiguration]
  [S3BucketAclGrantConfiguration]
  [S3BucketAclGrantConfiguration]
  [S3BucketAclGrantConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The proposed bucket policy for the Amazon S3 bucket.
s3BucketConfiguration_bucketPolicy :: Lens.Lens' S3BucketConfiguration (Prelude.Maybe Prelude.Text)
s3BucketConfiguration_bucketPolicy :: (Maybe Text -> f (Maybe Text))
-> S3BucketConfiguration -> f S3BucketConfiguration
s3BucketConfiguration_bucketPolicy = (S3BucketConfiguration -> Maybe Text)
-> (S3BucketConfiguration -> Maybe Text -> S3BucketConfiguration)
-> Lens
     S3BucketConfiguration
     S3BucketConfiguration
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3BucketConfiguration' {Maybe Text
bucketPolicy :: Maybe Text
$sel:bucketPolicy:S3BucketConfiguration' :: S3BucketConfiguration -> Maybe Text
bucketPolicy} -> Maybe Text
bucketPolicy) (\s :: S3BucketConfiguration
s@S3BucketConfiguration' {} Maybe Text
a -> S3BucketConfiguration
s {$sel:bucketPolicy:S3BucketConfiguration' :: Maybe Text
bucketPolicy = Maybe Text
a} :: S3BucketConfiguration)

instance Core.FromJSON S3BucketConfiguration where
  parseJSON :: Value -> Parser S3BucketConfiguration
parseJSON =
    String
-> (Object -> Parser S3BucketConfiguration)
-> Value
-> Parser S3BucketConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"S3BucketConfiguration"
      ( \Object
x ->
          Maybe (HashMap Text S3AccessPointConfiguration)
-> Maybe S3PublicAccessBlockConfiguration
-> Maybe [S3BucketAclGrantConfiguration]
-> Maybe Text
-> S3BucketConfiguration
S3BucketConfiguration'
            (Maybe (HashMap Text S3AccessPointConfiguration)
 -> Maybe S3PublicAccessBlockConfiguration
 -> Maybe [S3BucketAclGrantConfiguration]
 -> Maybe Text
 -> S3BucketConfiguration)
-> Parser (Maybe (HashMap Text S3AccessPointConfiguration))
-> Parser
     (Maybe S3PublicAccessBlockConfiguration
      -> Maybe [S3BucketAclGrantConfiguration]
      -> Maybe Text
      -> S3BucketConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object
-> Text
-> Parser (Maybe (Maybe (HashMap Text S3AccessPointConfiguration)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"accessPoints" Parser (Maybe (Maybe (HashMap Text S3AccessPointConfiguration)))
-> Maybe (HashMap Text S3AccessPointConfiguration)
-> Parser (Maybe (HashMap Text S3AccessPointConfiguration))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text S3AccessPointConfiguration)
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe S3PublicAccessBlockConfiguration
   -> Maybe [S3BucketAclGrantConfiguration]
   -> Maybe Text
   -> S3BucketConfiguration)
-> Parser (Maybe S3PublicAccessBlockConfiguration)
-> Parser
     (Maybe [S3BucketAclGrantConfiguration]
      -> Maybe Text -> S3BucketConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe S3PublicAccessBlockConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bucketPublicAccessBlock")
            Parser
  (Maybe [S3BucketAclGrantConfiguration]
   -> Maybe Text -> S3BucketConfiguration)
-> Parser (Maybe [S3BucketAclGrantConfiguration])
-> Parser (Maybe Text -> S3BucketConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object
-> Text -> Parser (Maybe (Maybe [S3BucketAclGrantConfiguration]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bucketAclGrants"
                            Parser (Maybe (Maybe [S3BucketAclGrantConfiguration]))
-> Maybe [S3BucketAclGrantConfiguration]
-> Parser (Maybe [S3BucketAclGrantConfiguration])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [S3BucketAclGrantConfiguration]
forall a. Monoid a => a
Prelude.mempty
                        )
            Parser (Maybe Text -> S3BucketConfiguration)
-> Parser (Maybe Text) -> Parser S3BucketConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"bucketPolicy")
      )

instance Prelude.Hashable S3BucketConfiguration

instance Prelude.NFData S3BucketConfiguration

instance Core.ToJSON S3BucketConfiguration where
  toJSON :: S3BucketConfiguration -> Value
toJSON S3BucketConfiguration' {Maybe [S3BucketAclGrantConfiguration]
Maybe Text
Maybe (HashMap Text S3AccessPointConfiguration)
Maybe S3PublicAccessBlockConfiguration
bucketPolicy :: Maybe Text
bucketAclGrants :: Maybe [S3BucketAclGrantConfiguration]
bucketPublicAccessBlock :: Maybe S3PublicAccessBlockConfiguration
accessPoints :: Maybe (HashMap Text S3AccessPointConfiguration)
$sel:bucketPolicy:S3BucketConfiguration' :: S3BucketConfiguration -> Maybe Text
$sel:bucketAclGrants:S3BucketConfiguration' :: S3BucketConfiguration -> Maybe [S3BucketAclGrantConfiguration]
$sel:bucketPublicAccessBlock:S3BucketConfiguration' :: S3BucketConfiguration -> Maybe S3PublicAccessBlockConfiguration
$sel:accessPoints:S3BucketConfiguration' :: S3BucketConfiguration
-> Maybe (HashMap Text S3AccessPointConfiguration)
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"accessPoints" Text -> HashMap Text S3AccessPointConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (HashMap Text S3AccessPointConfiguration -> Pair)
-> Maybe (HashMap Text S3AccessPointConfiguration) -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe (HashMap Text S3AccessPointConfiguration)
accessPoints,
            (Text
"bucketPublicAccessBlock" Text -> S3PublicAccessBlockConfiguration -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (S3PublicAccessBlockConfiguration -> Pair)
-> Maybe S3PublicAccessBlockConfiguration -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe S3PublicAccessBlockConfiguration
bucketPublicAccessBlock,
            (Text
"bucketAclGrants" Text -> [S3BucketAclGrantConfiguration] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([S3BucketAclGrantConfiguration] -> Pair)
-> Maybe [S3BucketAclGrantConfiguration] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [S3BucketAclGrantConfiguration]
bucketAclGrants,
            (Text
"bucketPolicy" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
bucketPolicy
          ]
      )