{-# 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.S3.Types.PublicAccessBlockConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.S3.Internal
data PublicAccessBlockConfiguration = PublicAccessBlockConfiguration'
{
PublicAccessBlockConfiguration -> Maybe Bool
ignorePublicAcls :: Prelude.Maybe Prelude.Bool,
PublicAccessBlockConfiguration -> Maybe Bool
blockPublicAcls :: Prelude.Maybe Prelude.Bool,
PublicAccessBlockConfiguration -> Maybe Bool
restrictPublicBuckets :: Prelude.Maybe Prelude.Bool,
PublicAccessBlockConfiguration -> Maybe Bool
blockPublicPolicy :: Prelude.Maybe Prelude.Bool
}
deriving (PublicAccessBlockConfiguration
-> PublicAccessBlockConfiguration -> Bool
(PublicAccessBlockConfiguration
-> PublicAccessBlockConfiguration -> Bool)
-> (PublicAccessBlockConfiguration
-> PublicAccessBlockConfiguration -> Bool)
-> Eq PublicAccessBlockConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PublicAccessBlockConfiguration
-> PublicAccessBlockConfiguration -> Bool
$c/= :: PublicAccessBlockConfiguration
-> PublicAccessBlockConfiguration -> Bool
== :: PublicAccessBlockConfiguration
-> PublicAccessBlockConfiguration -> Bool
$c== :: PublicAccessBlockConfiguration
-> PublicAccessBlockConfiguration -> Bool
Prelude.Eq, ReadPrec [PublicAccessBlockConfiguration]
ReadPrec PublicAccessBlockConfiguration
Int -> ReadS PublicAccessBlockConfiguration
ReadS [PublicAccessBlockConfiguration]
(Int -> ReadS PublicAccessBlockConfiguration)
-> ReadS [PublicAccessBlockConfiguration]
-> ReadPrec PublicAccessBlockConfiguration
-> ReadPrec [PublicAccessBlockConfiguration]
-> Read PublicAccessBlockConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PublicAccessBlockConfiguration]
$creadListPrec :: ReadPrec [PublicAccessBlockConfiguration]
readPrec :: ReadPrec PublicAccessBlockConfiguration
$creadPrec :: ReadPrec PublicAccessBlockConfiguration
readList :: ReadS [PublicAccessBlockConfiguration]
$creadList :: ReadS [PublicAccessBlockConfiguration]
readsPrec :: Int -> ReadS PublicAccessBlockConfiguration
$creadsPrec :: Int -> ReadS PublicAccessBlockConfiguration
Prelude.Read, Int -> PublicAccessBlockConfiguration -> ShowS
[PublicAccessBlockConfiguration] -> ShowS
PublicAccessBlockConfiguration -> String
(Int -> PublicAccessBlockConfiguration -> ShowS)
-> (PublicAccessBlockConfiguration -> String)
-> ([PublicAccessBlockConfiguration] -> ShowS)
-> Show PublicAccessBlockConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PublicAccessBlockConfiguration] -> ShowS
$cshowList :: [PublicAccessBlockConfiguration] -> ShowS
show :: PublicAccessBlockConfiguration -> String
$cshow :: PublicAccessBlockConfiguration -> String
showsPrec :: Int -> PublicAccessBlockConfiguration -> ShowS
$cshowsPrec :: Int -> PublicAccessBlockConfiguration -> ShowS
Prelude.Show, (forall x.
PublicAccessBlockConfiguration
-> Rep PublicAccessBlockConfiguration x)
-> (forall x.
Rep PublicAccessBlockConfiguration x
-> PublicAccessBlockConfiguration)
-> Generic PublicAccessBlockConfiguration
forall x.
Rep PublicAccessBlockConfiguration x
-> PublicAccessBlockConfiguration
forall x.
PublicAccessBlockConfiguration
-> Rep PublicAccessBlockConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PublicAccessBlockConfiguration x
-> PublicAccessBlockConfiguration
$cfrom :: forall x.
PublicAccessBlockConfiguration
-> Rep PublicAccessBlockConfiguration x
Prelude.Generic)
newPublicAccessBlockConfiguration ::
PublicAccessBlockConfiguration
newPublicAccessBlockConfiguration :: PublicAccessBlockConfiguration
newPublicAccessBlockConfiguration =
PublicAccessBlockConfiguration' :: Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> PublicAccessBlockConfiguration
PublicAccessBlockConfiguration'
{ $sel:ignorePublicAcls:PublicAccessBlockConfiguration' :: Maybe Bool
ignorePublicAcls =
Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:blockPublicAcls:PublicAccessBlockConfiguration' :: Maybe Bool
blockPublicAcls = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:restrictPublicBuckets:PublicAccessBlockConfiguration' :: Maybe Bool
restrictPublicBuckets = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:blockPublicPolicy:PublicAccessBlockConfiguration' :: Maybe Bool
blockPublicPolicy = Maybe Bool
forall a. Maybe a
Prelude.Nothing
}
publicAccessBlockConfiguration_ignorePublicAcls :: Lens.Lens' PublicAccessBlockConfiguration (Prelude.Maybe Prelude.Bool)
publicAccessBlockConfiguration_ignorePublicAcls :: (Maybe Bool -> f (Maybe Bool))
-> PublicAccessBlockConfiguration
-> f PublicAccessBlockConfiguration
publicAccessBlockConfiguration_ignorePublicAcls = (PublicAccessBlockConfiguration -> Maybe Bool)
-> (PublicAccessBlockConfiguration
-> Maybe Bool -> PublicAccessBlockConfiguration)
-> Lens
PublicAccessBlockConfiguration
PublicAccessBlockConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicAccessBlockConfiguration' {Maybe Bool
ignorePublicAcls :: Maybe Bool
$sel:ignorePublicAcls:PublicAccessBlockConfiguration' :: PublicAccessBlockConfiguration -> Maybe Bool
ignorePublicAcls} -> Maybe Bool
ignorePublicAcls) (\s :: PublicAccessBlockConfiguration
s@PublicAccessBlockConfiguration' {} Maybe Bool
a -> PublicAccessBlockConfiguration
s {$sel:ignorePublicAcls:PublicAccessBlockConfiguration' :: Maybe Bool
ignorePublicAcls = Maybe Bool
a} :: PublicAccessBlockConfiguration)
publicAccessBlockConfiguration_blockPublicAcls :: Lens.Lens' PublicAccessBlockConfiguration (Prelude.Maybe Prelude.Bool)
publicAccessBlockConfiguration_blockPublicAcls :: (Maybe Bool -> f (Maybe Bool))
-> PublicAccessBlockConfiguration
-> f PublicAccessBlockConfiguration
publicAccessBlockConfiguration_blockPublicAcls = (PublicAccessBlockConfiguration -> Maybe Bool)
-> (PublicAccessBlockConfiguration
-> Maybe Bool -> PublicAccessBlockConfiguration)
-> Lens
PublicAccessBlockConfiguration
PublicAccessBlockConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicAccessBlockConfiguration' {Maybe Bool
blockPublicAcls :: Maybe Bool
$sel:blockPublicAcls:PublicAccessBlockConfiguration' :: PublicAccessBlockConfiguration -> Maybe Bool
blockPublicAcls} -> Maybe Bool
blockPublicAcls) (\s :: PublicAccessBlockConfiguration
s@PublicAccessBlockConfiguration' {} Maybe Bool
a -> PublicAccessBlockConfiguration
s {$sel:blockPublicAcls:PublicAccessBlockConfiguration' :: Maybe Bool
blockPublicAcls = Maybe Bool
a} :: PublicAccessBlockConfiguration)
publicAccessBlockConfiguration_restrictPublicBuckets :: Lens.Lens' PublicAccessBlockConfiguration (Prelude.Maybe Prelude.Bool)
publicAccessBlockConfiguration_restrictPublicBuckets :: (Maybe Bool -> f (Maybe Bool))
-> PublicAccessBlockConfiguration
-> f PublicAccessBlockConfiguration
publicAccessBlockConfiguration_restrictPublicBuckets = (PublicAccessBlockConfiguration -> Maybe Bool)
-> (PublicAccessBlockConfiguration
-> Maybe Bool -> PublicAccessBlockConfiguration)
-> Lens
PublicAccessBlockConfiguration
PublicAccessBlockConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicAccessBlockConfiguration' {Maybe Bool
restrictPublicBuckets :: Maybe Bool
$sel:restrictPublicBuckets:PublicAccessBlockConfiguration' :: PublicAccessBlockConfiguration -> Maybe Bool
restrictPublicBuckets} -> Maybe Bool
restrictPublicBuckets) (\s :: PublicAccessBlockConfiguration
s@PublicAccessBlockConfiguration' {} Maybe Bool
a -> PublicAccessBlockConfiguration
s {$sel:restrictPublicBuckets:PublicAccessBlockConfiguration' :: Maybe Bool
restrictPublicBuckets = Maybe Bool
a} :: PublicAccessBlockConfiguration)
publicAccessBlockConfiguration_blockPublicPolicy :: Lens.Lens' PublicAccessBlockConfiguration (Prelude.Maybe Prelude.Bool)
publicAccessBlockConfiguration_blockPublicPolicy :: (Maybe Bool -> f (Maybe Bool))
-> PublicAccessBlockConfiguration
-> f PublicAccessBlockConfiguration
publicAccessBlockConfiguration_blockPublicPolicy = (PublicAccessBlockConfiguration -> Maybe Bool)
-> (PublicAccessBlockConfiguration
-> Maybe Bool -> PublicAccessBlockConfiguration)
-> Lens
PublicAccessBlockConfiguration
PublicAccessBlockConfiguration
(Maybe Bool)
(Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PublicAccessBlockConfiguration' {Maybe Bool
blockPublicPolicy :: Maybe Bool
$sel:blockPublicPolicy:PublicAccessBlockConfiguration' :: PublicAccessBlockConfiguration -> Maybe Bool
blockPublicPolicy} -> Maybe Bool
blockPublicPolicy) (\s :: PublicAccessBlockConfiguration
s@PublicAccessBlockConfiguration' {} Maybe Bool
a -> PublicAccessBlockConfiguration
s {$sel:blockPublicPolicy:PublicAccessBlockConfiguration' :: Maybe Bool
blockPublicPolicy = Maybe Bool
a} :: PublicAccessBlockConfiguration)
instance Core.FromXML PublicAccessBlockConfiguration where
parseXML :: [Node] -> Either String PublicAccessBlockConfiguration
parseXML [Node]
x =
Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> PublicAccessBlockConfiguration
PublicAccessBlockConfiguration'
(Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> Maybe Bool
-> PublicAccessBlockConfiguration)
-> Either String (Maybe Bool)
-> Either
String
(Maybe Bool
-> Maybe Bool -> Maybe Bool -> PublicAccessBlockConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"IgnorePublicAcls")
Either
String
(Maybe Bool
-> Maybe Bool -> Maybe Bool -> PublicAccessBlockConfiguration)
-> Either String (Maybe Bool)
-> Either
String (Maybe Bool -> Maybe Bool -> PublicAccessBlockConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"BlockPublicAcls")
Either
String (Maybe Bool -> Maybe Bool -> PublicAccessBlockConfiguration)
-> Either String (Maybe Bool)
-> Either String (Maybe Bool -> PublicAccessBlockConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"RestrictPublicBuckets")
Either String (Maybe Bool -> PublicAccessBlockConfiguration)
-> Either String (Maybe Bool)
-> Either String PublicAccessBlockConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"BlockPublicPolicy")
instance
Prelude.Hashable
PublicAccessBlockConfiguration
instance
Prelude.NFData
PublicAccessBlockConfiguration
instance Core.ToXML PublicAccessBlockConfiguration where
toXML :: PublicAccessBlockConfiguration -> XML
toXML PublicAccessBlockConfiguration' {Maybe Bool
blockPublicPolicy :: Maybe Bool
restrictPublicBuckets :: Maybe Bool
blockPublicAcls :: Maybe Bool
ignorePublicAcls :: Maybe Bool
$sel:blockPublicPolicy:PublicAccessBlockConfiguration' :: PublicAccessBlockConfiguration -> Maybe Bool
$sel:restrictPublicBuckets:PublicAccessBlockConfiguration' :: PublicAccessBlockConfiguration -> Maybe Bool
$sel:blockPublicAcls:PublicAccessBlockConfiguration' :: PublicAccessBlockConfiguration -> Maybe Bool
$sel:ignorePublicAcls:PublicAccessBlockConfiguration' :: PublicAccessBlockConfiguration -> Maybe Bool
..} =
[XML] -> XML
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ Name
"IgnorePublicAcls" Name -> Maybe Bool -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Bool
ignorePublicAcls,
Name
"BlockPublicAcls" Name -> Maybe Bool -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Bool
blockPublicAcls,
Name
"RestrictPublicBuckets"
Name -> Maybe Bool -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Bool
restrictPublicBuckets,
Name
"BlockPublicPolicy" Name -> Maybe Bool -> XML
forall a. ToXML a => Name -> a -> XML
Core.@= Maybe Bool
blockPublicPolicy
]