{-# 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.AccessAnalyzer.Types.S3PublicAccessBlockConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data S3PublicAccessBlockConfiguration = S3PublicAccessBlockConfiguration'
{
S3PublicAccessBlockConfiguration -> Bool
ignorePublicAcls :: Prelude.Bool,
S3PublicAccessBlockConfiguration -> Bool
restrictPublicBuckets :: Prelude.Bool
}
deriving (S3PublicAccessBlockConfiguration
-> S3PublicAccessBlockConfiguration -> Bool
(S3PublicAccessBlockConfiguration
-> S3PublicAccessBlockConfiguration -> Bool)
-> (S3PublicAccessBlockConfiguration
-> S3PublicAccessBlockConfiguration -> Bool)
-> Eq S3PublicAccessBlockConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: S3PublicAccessBlockConfiguration
-> S3PublicAccessBlockConfiguration -> Bool
$c/= :: S3PublicAccessBlockConfiguration
-> S3PublicAccessBlockConfiguration -> Bool
== :: S3PublicAccessBlockConfiguration
-> S3PublicAccessBlockConfiguration -> Bool
$c== :: S3PublicAccessBlockConfiguration
-> S3PublicAccessBlockConfiguration -> Bool
Prelude.Eq, ReadPrec [S3PublicAccessBlockConfiguration]
ReadPrec S3PublicAccessBlockConfiguration
Int -> ReadS S3PublicAccessBlockConfiguration
ReadS [S3PublicAccessBlockConfiguration]
(Int -> ReadS S3PublicAccessBlockConfiguration)
-> ReadS [S3PublicAccessBlockConfiguration]
-> ReadPrec S3PublicAccessBlockConfiguration
-> ReadPrec [S3PublicAccessBlockConfiguration]
-> Read S3PublicAccessBlockConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [S3PublicAccessBlockConfiguration]
$creadListPrec :: ReadPrec [S3PublicAccessBlockConfiguration]
readPrec :: ReadPrec S3PublicAccessBlockConfiguration
$creadPrec :: ReadPrec S3PublicAccessBlockConfiguration
readList :: ReadS [S3PublicAccessBlockConfiguration]
$creadList :: ReadS [S3PublicAccessBlockConfiguration]
readsPrec :: Int -> ReadS S3PublicAccessBlockConfiguration
$creadsPrec :: Int -> ReadS S3PublicAccessBlockConfiguration
Prelude.Read, Int -> S3PublicAccessBlockConfiguration -> ShowS
[S3PublicAccessBlockConfiguration] -> ShowS
S3PublicAccessBlockConfiguration -> String
(Int -> S3PublicAccessBlockConfiguration -> ShowS)
-> (S3PublicAccessBlockConfiguration -> String)
-> ([S3PublicAccessBlockConfiguration] -> ShowS)
-> Show S3PublicAccessBlockConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [S3PublicAccessBlockConfiguration] -> ShowS
$cshowList :: [S3PublicAccessBlockConfiguration] -> ShowS
show :: S3PublicAccessBlockConfiguration -> String
$cshow :: S3PublicAccessBlockConfiguration -> String
showsPrec :: Int -> S3PublicAccessBlockConfiguration -> ShowS
$cshowsPrec :: Int -> S3PublicAccessBlockConfiguration -> ShowS
Prelude.Show, (forall x.
S3PublicAccessBlockConfiguration
-> Rep S3PublicAccessBlockConfiguration x)
-> (forall x.
Rep S3PublicAccessBlockConfiguration x
-> S3PublicAccessBlockConfiguration)
-> Generic S3PublicAccessBlockConfiguration
forall x.
Rep S3PublicAccessBlockConfiguration x
-> S3PublicAccessBlockConfiguration
forall x.
S3PublicAccessBlockConfiguration
-> Rep S3PublicAccessBlockConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep S3PublicAccessBlockConfiguration x
-> S3PublicAccessBlockConfiguration
$cfrom :: forall x.
S3PublicAccessBlockConfiguration
-> Rep S3PublicAccessBlockConfiguration x
Prelude.Generic)
newS3PublicAccessBlockConfiguration ::
Prelude.Bool ->
Prelude.Bool ->
S3PublicAccessBlockConfiguration
newS3PublicAccessBlockConfiguration :: Bool -> Bool -> S3PublicAccessBlockConfiguration
newS3PublicAccessBlockConfiguration
Bool
pIgnorePublicAcls_
Bool
pRestrictPublicBuckets_ =
S3PublicAccessBlockConfiguration' :: Bool -> Bool -> S3PublicAccessBlockConfiguration
S3PublicAccessBlockConfiguration'
{ $sel:ignorePublicAcls:S3PublicAccessBlockConfiguration' :: Bool
ignorePublicAcls =
Bool
pIgnorePublicAcls_,
$sel:restrictPublicBuckets:S3PublicAccessBlockConfiguration' :: Bool
restrictPublicBuckets =
Bool
pRestrictPublicBuckets_
}
s3PublicAccessBlockConfiguration_ignorePublicAcls :: Lens.Lens' S3PublicAccessBlockConfiguration Prelude.Bool
s3PublicAccessBlockConfiguration_ignorePublicAcls :: (Bool -> f Bool)
-> S3PublicAccessBlockConfiguration
-> f S3PublicAccessBlockConfiguration
s3PublicAccessBlockConfiguration_ignorePublicAcls = (S3PublicAccessBlockConfiguration -> Bool)
-> (S3PublicAccessBlockConfiguration
-> Bool -> S3PublicAccessBlockConfiguration)
-> Lens
S3PublicAccessBlockConfiguration
S3PublicAccessBlockConfiguration
Bool
Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3PublicAccessBlockConfiguration' {Bool
ignorePublicAcls :: Bool
$sel:ignorePublicAcls:S3PublicAccessBlockConfiguration' :: S3PublicAccessBlockConfiguration -> Bool
ignorePublicAcls} -> Bool
ignorePublicAcls) (\s :: S3PublicAccessBlockConfiguration
s@S3PublicAccessBlockConfiguration' {} Bool
a -> S3PublicAccessBlockConfiguration
s {$sel:ignorePublicAcls:S3PublicAccessBlockConfiguration' :: Bool
ignorePublicAcls = Bool
a} :: S3PublicAccessBlockConfiguration)
s3PublicAccessBlockConfiguration_restrictPublicBuckets :: Lens.Lens' S3PublicAccessBlockConfiguration Prelude.Bool
s3PublicAccessBlockConfiguration_restrictPublicBuckets :: (Bool -> f Bool)
-> S3PublicAccessBlockConfiguration
-> f S3PublicAccessBlockConfiguration
s3PublicAccessBlockConfiguration_restrictPublicBuckets = (S3PublicAccessBlockConfiguration -> Bool)
-> (S3PublicAccessBlockConfiguration
-> Bool -> S3PublicAccessBlockConfiguration)
-> Lens
S3PublicAccessBlockConfiguration
S3PublicAccessBlockConfiguration
Bool
Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\S3PublicAccessBlockConfiguration' {Bool
restrictPublicBuckets :: Bool
$sel:restrictPublicBuckets:S3PublicAccessBlockConfiguration' :: S3PublicAccessBlockConfiguration -> Bool
restrictPublicBuckets} -> Bool
restrictPublicBuckets) (\s :: S3PublicAccessBlockConfiguration
s@S3PublicAccessBlockConfiguration' {} Bool
a -> S3PublicAccessBlockConfiguration
s {$sel:restrictPublicBuckets:S3PublicAccessBlockConfiguration' :: Bool
restrictPublicBuckets = Bool
a} :: S3PublicAccessBlockConfiguration)
instance
Core.FromJSON
S3PublicAccessBlockConfiguration
where
parseJSON :: Value -> Parser S3PublicAccessBlockConfiguration
parseJSON =
String
-> (Object -> Parser S3PublicAccessBlockConfiguration)
-> Value
-> Parser S3PublicAccessBlockConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"S3PublicAccessBlockConfiguration"
( \Object
x ->
Bool -> Bool -> S3PublicAccessBlockConfiguration
S3PublicAccessBlockConfiguration'
(Bool -> Bool -> S3PublicAccessBlockConfiguration)
-> Parser Bool -> Parser (Bool -> S3PublicAccessBlockConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ignorePublicAcls")
Parser (Bool -> S3PublicAccessBlockConfiguration)
-> Parser Bool -> Parser S3PublicAccessBlockConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Bool
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"restrictPublicBuckets")
)
instance
Prelude.Hashable
S3PublicAccessBlockConfiguration
instance
Prelude.NFData
S3PublicAccessBlockConfiguration
instance Core.ToJSON S3PublicAccessBlockConfiguration where
toJSON :: S3PublicAccessBlockConfiguration -> Value
toJSON S3PublicAccessBlockConfiguration' {Bool
restrictPublicBuckets :: Bool
ignorePublicAcls :: Bool
$sel:restrictPublicBuckets:S3PublicAccessBlockConfiguration' :: S3PublicAccessBlockConfiguration -> Bool
$sel:ignorePublicAcls:S3PublicAccessBlockConfiguration' :: S3PublicAccessBlockConfiguration -> Bool
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"ignorePublicAcls" Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
ignorePublicAcls),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"restrictPublicBuckets"
Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
restrictPublicBuckets
)
]
)