{-# 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.Lens as Lens
import Amazonka.MacieV2.Types.BucketPermissionConfiguration
import Amazonka.MacieV2.Types.EffectivePermission
import qualified Amazonka.Prelude as Prelude
data BucketPublicAccess = BucketPublicAccess'
{
BucketPublicAccess -> Maybe BucketPermissionConfiguration
permissionConfiguration :: Prelude.Maybe BucketPermissionConfiguration,
BucketPublicAccess -> Maybe EffectivePermission
effectivePermission :: Prelude.Maybe EffectivePermission
}
deriving (BucketPublicAccess -> BucketPublicAccess -> Bool
(BucketPublicAccess -> BucketPublicAccess -> Bool)
-> (BucketPublicAccess -> BucketPublicAccess -> Bool)
-> Eq BucketPublicAccess
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]
(Int -> ReadS BucketPublicAccess)
-> ReadS [BucketPublicAccess]
-> ReadPrec BucketPublicAccess
-> ReadPrec [BucketPublicAccess]
-> Read 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
(Int -> BucketPublicAccess -> ShowS)
-> (BucketPublicAccess -> String)
-> ([BucketPublicAccess] -> ShowS)
-> Show BucketPublicAccess
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. BucketPublicAccess -> Rep BucketPublicAccess x)
-> (forall x. Rep BucketPublicAccess x -> BucketPublicAccess)
-> Generic BucketPublicAccess
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' :: Maybe BucketPermissionConfiguration
-> Maybe EffectivePermission -> BucketPublicAccess
BucketPublicAccess'
{ $sel:permissionConfiguration:BucketPublicAccess' :: Maybe BucketPermissionConfiguration
permissionConfiguration =
Maybe BucketPermissionConfiguration
forall a. Maybe a
Prelude.Nothing,
$sel:effectivePermission:BucketPublicAccess' :: Maybe EffectivePermission
effectivePermission = Maybe EffectivePermission
forall a. Maybe a
Prelude.Nothing
}
bucketPublicAccess_permissionConfiguration :: Lens.Lens' BucketPublicAccess (Prelude.Maybe BucketPermissionConfiguration)
bucketPublicAccess_permissionConfiguration :: (Maybe BucketPermissionConfiguration
-> f (Maybe BucketPermissionConfiguration))
-> BucketPublicAccess -> f BucketPublicAccess
bucketPublicAccess_permissionConfiguration = (BucketPublicAccess -> Maybe BucketPermissionConfiguration)
-> (BucketPublicAccess
-> Maybe BucketPermissionConfiguration -> BucketPublicAccess)
-> Lens
BucketPublicAccess
BucketPublicAccess
(Maybe BucketPermissionConfiguration)
(Maybe BucketPermissionConfiguration)
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)
bucketPublicAccess_effectivePermission :: Lens.Lens' BucketPublicAccess (Prelude.Maybe EffectivePermission)
bucketPublicAccess_effectivePermission :: (Maybe EffectivePermission -> f (Maybe EffectivePermission))
-> BucketPublicAccess -> f BucketPublicAccess
bucketPublicAccess_effectivePermission = (BucketPublicAccess -> Maybe EffectivePermission)
-> (BucketPublicAccess
-> Maybe EffectivePermission -> BucketPublicAccess)
-> Lens
BucketPublicAccess
BucketPublicAccess
(Maybe EffectivePermission)
(Maybe 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)
instance Core.FromJSON BucketPublicAccess where
parseJSON :: Value -> Parser BucketPublicAccess
parseJSON =
String
-> (Object -> Parser BucketPublicAccess)
-> Value
-> Parser BucketPublicAccess
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BucketPublicAccess"
( \Object
x ->
Maybe BucketPermissionConfiguration
-> Maybe EffectivePermission -> BucketPublicAccess
BucketPublicAccess'
(Maybe BucketPermissionConfiguration
-> Maybe EffectivePermission -> BucketPublicAccess)
-> Parser (Maybe BucketPermissionConfiguration)
-> Parser (Maybe EffectivePermission -> BucketPublicAccess)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe BucketPermissionConfiguration)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"permissionConfiguration")
Parser (Maybe EffectivePermission -> BucketPublicAccess)
-> Parser (Maybe EffectivePermission) -> Parser BucketPublicAccess
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe EffectivePermission)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"effectivePermission")
)
instance Prelude.Hashable BucketPublicAccess
instance Prelude.NFData BucketPublicAccess