{-# 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 #-}
module Amazonka.MacieV2.Types.BucketPublicAccess where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MacieV2.Types.BucketPermissionConfiguration
import Amazonka.MacieV2.Types.EffectivePermission
import qualified Amazonka.Prelude as Prelude
data BucketPublicAccess = BucketPublicAccess'
{
BucketPublicAccess -> Maybe EffectivePermission
effectivePermission :: Prelude.Maybe EffectivePermission,
BucketPublicAccess -> Maybe BucketPermissionConfiguration
permissionConfiguration :: Prelude.Maybe BucketPermissionConfiguration
}
deriving (BucketPublicAccess -> BucketPublicAccess -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BucketPublicAccess -> BucketPublicAccess -> Bool
$c/= :: BucketPublicAccess -> BucketPublicAccess -> Bool
== :: BucketPublicAccess -> BucketPublicAccess -> Bool
$c== :: BucketPublicAccess -> BucketPublicAccess -> Bool
Prelude.Eq, ReadPrec [BucketPublicAccess]
ReadPrec BucketPublicAccess
Int -> ReadS BucketPublicAccess
ReadS [BucketPublicAccess]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BucketPublicAccess]
$creadListPrec :: ReadPrec [BucketPublicAccess]
readPrec :: ReadPrec BucketPublicAccess
$creadPrec :: ReadPrec BucketPublicAccess
readList :: ReadS [BucketPublicAccess]
$creadList :: ReadS [BucketPublicAccess]
readsPrec :: Int -> ReadS BucketPublicAccess
$creadsPrec :: Int -> ReadS BucketPublicAccess
Prelude.Read, Int -> BucketPublicAccess -> ShowS
[BucketPublicAccess] -> ShowS
BucketPublicAccess -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BucketPublicAccess] -> ShowS
$cshowList :: [BucketPublicAccess] -> ShowS
show :: BucketPublicAccess -> String
$cshow :: BucketPublicAccess -> String
showsPrec :: Int -> BucketPublicAccess -> ShowS
$cshowsPrec :: Int -> BucketPublicAccess -> ShowS
Prelude.Show, forall x. Rep BucketPublicAccess x -> BucketPublicAccess
forall x. BucketPublicAccess -> Rep BucketPublicAccess x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep BucketPublicAccess x -> BucketPublicAccess
$cfrom :: forall x. BucketPublicAccess -> Rep BucketPublicAccess x
Prelude.Generic)
newBucketPublicAccess ::
BucketPublicAccess
newBucketPublicAccess :: BucketPublicAccess
newBucketPublicAccess =
BucketPublicAccess'
{ $sel:effectivePermission:BucketPublicAccess' :: Maybe EffectivePermission
effectivePermission =
forall a. Maybe a
Prelude.Nothing,
$sel:permissionConfiguration:BucketPublicAccess' :: Maybe BucketPermissionConfiguration
permissionConfiguration = forall a. Maybe a
Prelude.Nothing
}
bucketPublicAccess_effectivePermission :: Lens.Lens' BucketPublicAccess (Prelude.Maybe EffectivePermission)
bucketPublicAccess_effectivePermission :: Lens' BucketPublicAccess (Maybe EffectivePermission)
bucketPublicAccess_effectivePermission = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketPublicAccess' {Maybe EffectivePermission
effectivePermission :: Maybe EffectivePermission
$sel:effectivePermission:BucketPublicAccess' :: BucketPublicAccess -> Maybe EffectivePermission
effectivePermission} -> Maybe EffectivePermission
effectivePermission) (\s :: BucketPublicAccess
s@BucketPublicAccess' {} Maybe EffectivePermission
a -> BucketPublicAccess
s {$sel:effectivePermission:BucketPublicAccess' :: Maybe EffectivePermission
effectivePermission = Maybe EffectivePermission
a} :: BucketPublicAccess)
bucketPublicAccess_permissionConfiguration :: Lens.Lens' BucketPublicAccess (Prelude.Maybe BucketPermissionConfiguration)
bucketPublicAccess_permissionConfiguration :: Lens' BucketPublicAccess (Maybe BucketPermissionConfiguration)
bucketPublicAccess_permissionConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BucketPublicAccess' {Maybe BucketPermissionConfiguration
permissionConfiguration :: Maybe BucketPermissionConfiguration
$sel:permissionConfiguration:BucketPublicAccess' :: BucketPublicAccess -> Maybe BucketPermissionConfiguration
permissionConfiguration} -> Maybe BucketPermissionConfiguration
permissionConfiguration) (\s :: BucketPublicAccess
s@BucketPublicAccess' {} Maybe BucketPermissionConfiguration
a -> BucketPublicAccess
s {$sel:permissionConfiguration:BucketPublicAccess' :: Maybe BucketPermissionConfiguration
permissionConfiguration = Maybe BucketPermissionConfiguration
a} :: BucketPublicAccess)
instance Data.FromJSON BucketPublicAccess where
parseJSON :: Value -> Parser BucketPublicAccess
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"BucketPublicAccess"
( \Object
x ->
Maybe EffectivePermission
-> Maybe BucketPermissionConfiguration -> BucketPublicAccess
BucketPublicAccess'
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
"effectivePermission")
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
"permissionConfiguration")
)
instance Prelude.Hashable BucketPublicAccess where
hashWithSalt :: Int -> BucketPublicAccess -> Int
hashWithSalt Int
_salt BucketPublicAccess' {Maybe BucketPermissionConfiguration
Maybe EffectivePermission
permissionConfiguration :: Maybe BucketPermissionConfiguration
effectivePermission :: Maybe EffectivePermission
$sel:permissionConfiguration:BucketPublicAccess' :: BucketPublicAccess -> Maybe BucketPermissionConfiguration
$sel:effectivePermission:BucketPublicAccess' :: BucketPublicAccess -> Maybe EffectivePermission
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EffectivePermission
effectivePermission
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe BucketPermissionConfiguration
permissionConfiguration
instance Prelude.NFData BucketPublicAccess where
rnf :: BucketPublicAccess -> ()
rnf BucketPublicAccess' {Maybe BucketPermissionConfiguration
Maybe EffectivePermission
permissionConfiguration :: Maybe BucketPermissionConfiguration
effectivePermission :: Maybe EffectivePermission
$sel:permissionConfiguration:BucketPublicAccess' :: BucketPublicAccess -> Maybe BucketPermissionConfiguration
$sel:effectivePermission:BucketPublicAccess' :: BucketPublicAccess -> Maybe EffectivePermission
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe EffectivePermission
effectivePermission
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe BucketPermissionConfiguration
permissionConfiguration