{-# 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.EMR.Types.BlockPublicAccessConfiguration where
import qualified Amazonka.Core as Core
import Amazonka.EMR.Types.PortRange
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data BlockPublicAccessConfiguration = BlockPublicAccessConfiguration'
{
BlockPublicAccessConfiguration -> Maybe [PortRange]
permittedPublicSecurityGroupRuleRanges :: Prelude.Maybe [PortRange],
BlockPublicAccessConfiguration -> Bool
blockPublicSecurityGroupRules :: Prelude.Bool
}
deriving (BlockPublicAccessConfiguration
-> BlockPublicAccessConfiguration -> Bool
(BlockPublicAccessConfiguration
-> BlockPublicAccessConfiguration -> Bool)
-> (BlockPublicAccessConfiguration
-> BlockPublicAccessConfiguration -> Bool)
-> Eq BlockPublicAccessConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: BlockPublicAccessConfiguration
-> BlockPublicAccessConfiguration -> Bool
$c/= :: BlockPublicAccessConfiguration
-> BlockPublicAccessConfiguration -> Bool
== :: BlockPublicAccessConfiguration
-> BlockPublicAccessConfiguration -> Bool
$c== :: BlockPublicAccessConfiguration
-> BlockPublicAccessConfiguration -> Bool
Prelude.Eq, ReadPrec [BlockPublicAccessConfiguration]
ReadPrec BlockPublicAccessConfiguration
Int -> ReadS BlockPublicAccessConfiguration
ReadS [BlockPublicAccessConfiguration]
(Int -> ReadS BlockPublicAccessConfiguration)
-> ReadS [BlockPublicAccessConfiguration]
-> ReadPrec BlockPublicAccessConfiguration
-> ReadPrec [BlockPublicAccessConfiguration]
-> Read BlockPublicAccessConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [BlockPublicAccessConfiguration]
$creadListPrec :: ReadPrec [BlockPublicAccessConfiguration]
readPrec :: ReadPrec BlockPublicAccessConfiguration
$creadPrec :: ReadPrec BlockPublicAccessConfiguration
readList :: ReadS [BlockPublicAccessConfiguration]
$creadList :: ReadS [BlockPublicAccessConfiguration]
readsPrec :: Int -> ReadS BlockPublicAccessConfiguration
$creadsPrec :: Int -> ReadS BlockPublicAccessConfiguration
Prelude.Read, Int -> BlockPublicAccessConfiguration -> ShowS
[BlockPublicAccessConfiguration] -> ShowS
BlockPublicAccessConfiguration -> String
(Int -> BlockPublicAccessConfiguration -> ShowS)
-> (BlockPublicAccessConfiguration -> String)
-> ([BlockPublicAccessConfiguration] -> ShowS)
-> Show BlockPublicAccessConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [BlockPublicAccessConfiguration] -> ShowS
$cshowList :: [BlockPublicAccessConfiguration] -> ShowS
show :: BlockPublicAccessConfiguration -> String
$cshow :: BlockPublicAccessConfiguration -> String
showsPrec :: Int -> BlockPublicAccessConfiguration -> ShowS
$cshowsPrec :: Int -> BlockPublicAccessConfiguration -> ShowS
Prelude.Show, (forall x.
BlockPublicAccessConfiguration
-> Rep BlockPublicAccessConfiguration x)
-> (forall x.
Rep BlockPublicAccessConfiguration x
-> BlockPublicAccessConfiguration)
-> Generic BlockPublicAccessConfiguration
forall x.
Rep BlockPublicAccessConfiguration x
-> BlockPublicAccessConfiguration
forall x.
BlockPublicAccessConfiguration
-> Rep BlockPublicAccessConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep BlockPublicAccessConfiguration x
-> BlockPublicAccessConfiguration
$cfrom :: forall x.
BlockPublicAccessConfiguration
-> Rep BlockPublicAccessConfiguration x
Prelude.Generic)
newBlockPublicAccessConfiguration ::
Prelude.Bool ->
BlockPublicAccessConfiguration
newBlockPublicAccessConfiguration :: Bool -> BlockPublicAccessConfiguration
newBlockPublicAccessConfiguration
Bool
pBlockPublicSecurityGroupRules_ =
BlockPublicAccessConfiguration' :: Maybe [PortRange] -> Bool -> BlockPublicAccessConfiguration
BlockPublicAccessConfiguration'
{ $sel:permittedPublicSecurityGroupRuleRanges:BlockPublicAccessConfiguration' :: Maybe [PortRange]
permittedPublicSecurityGroupRuleRanges =
Maybe [PortRange]
forall a. Maybe a
Prelude.Nothing,
$sel:blockPublicSecurityGroupRules:BlockPublicAccessConfiguration' :: Bool
blockPublicSecurityGroupRules =
Bool
pBlockPublicSecurityGroupRules_
}
blockPublicAccessConfiguration_permittedPublicSecurityGroupRuleRanges :: Lens.Lens' BlockPublicAccessConfiguration (Prelude.Maybe [PortRange])
blockPublicAccessConfiguration_permittedPublicSecurityGroupRuleRanges :: (Maybe [PortRange] -> f (Maybe [PortRange]))
-> BlockPublicAccessConfiguration
-> f BlockPublicAccessConfiguration
blockPublicAccessConfiguration_permittedPublicSecurityGroupRuleRanges = (BlockPublicAccessConfiguration -> Maybe [PortRange])
-> (BlockPublicAccessConfiguration
-> Maybe [PortRange] -> BlockPublicAccessConfiguration)
-> Lens
BlockPublicAccessConfiguration
BlockPublicAccessConfiguration
(Maybe [PortRange])
(Maybe [PortRange])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlockPublicAccessConfiguration' {Maybe [PortRange]
permittedPublicSecurityGroupRuleRanges :: Maybe [PortRange]
$sel:permittedPublicSecurityGroupRuleRanges:BlockPublicAccessConfiguration' :: BlockPublicAccessConfiguration -> Maybe [PortRange]
permittedPublicSecurityGroupRuleRanges} -> Maybe [PortRange]
permittedPublicSecurityGroupRuleRanges) (\s :: BlockPublicAccessConfiguration
s@BlockPublicAccessConfiguration' {} Maybe [PortRange]
a -> BlockPublicAccessConfiguration
s {$sel:permittedPublicSecurityGroupRuleRanges:BlockPublicAccessConfiguration' :: Maybe [PortRange]
permittedPublicSecurityGroupRuleRanges = Maybe [PortRange]
a} :: BlockPublicAccessConfiguration) ((Maybe [PortRange] -> f (Maybe [PortRange]))
-> BlockPublicAccessConfiguration
-> f BlockPublicAccessConfiguration)
-> ((Maybe [PortRange] -> f (Maybe [PortRange]))
-> Maybe [PortRange] -> f (Maybe [PortRange]))
-> (Maybe [PortRange] -> f (Maybe [PortRange]))
-> BlockPublicAccessConfiguration
-> f BlockPublicAccessConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [PortRange] [PortRange] [PortRange] [PortRange]
-> Iso
(Maybe [PortRange])
(Maybe [PortRange])
(Maybe [PortRange])
(Maybe [PortRange])
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 [PortRange] [PortRange] [PortRange] [PortRange]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
blockPublicAccessConfiguration_blockPublicSecurityGroupRules :: Lens.Lens' BlockPublicAccessConfiguration Prelude.Bool
blockPublicAccessConfiguration_blockPublicSecurityGroupRules :: (Bool -> f Bool)
-> BlockPublicAccessConfiguration
-> f BlockPublicAccessConfiguration
blockPublicAccessConfiguration_blockPublicSecurityGroupRules = (BlockPublicAccessConfiguration -> Bool)
-> (BlockPublicAccessConfiguration
-> Bool -> BlockPublicAccessConfiguration)
-> Lens
BlockPublicAccessConfiguration
BlockPublicAccessConfiguration
Bool
Bool
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\BlockPublicAccessConfiguration' {Bool
blockPublicSecurityGroupRules :: Bool
$sel:blockPublicSecurityGroupRules:BlockPublicAccessConfiguration' :: BlockPublicAccessConfiguration -> Bool
blockPublicSecurityGroupRules} -> Bool
blockPublicSecurityGroupRules) (\s :: BlockPublicAccessConfiguration
s@BlockPublicAccessConfiguration' {} Bool
a -> BlockPublicAccessConfiguration
s {$sel:blockPublicSecurityGroupRules:BlockPublicAccessConfiguration' :: Bool
blockPublicSecurityGroupRules = Bool
a} :: BlockPublicAccessConfiguration)
instance Core.FromJSON BlockPublicAccessConfiguration where
parseJSON :: Value -> Parser BlockPublicAccessConfiguration
parseJSON =
String
-> (Object -> Parser BlockPublicAccessConfiguration)
-> Value
-> Parser BlockPublicAccessConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"BlockPublicAccessConfiguration"
( \Object
x ->
Maybe [PortRange] -> Bool -> BlockPublicAccessConfiguration
BlockPublicAccessConfiguration'
(Maybe [PortRange] -> Bool -> BlockPublicAccessConfiguration)
-> Parser (Maybe [PortRange])
-> Parser (Bool -> BlockPublicAccessConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [PortRange]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"PermittedPublicSecurityGroupRuleRanges"
Parser (Maybe (Maybe [PortRange]))
-> Maybe [PortRange] -> Parser (Maybe [PortRange])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [PortRange]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Bool -> BlockPublicAccessConfiguration)
-> Parser Bool -> Parser BlockPublicAccessConfiguration
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
"BlockPublicSecurityGroupRules")
)
instance
Prelude.Hashable
BlockPublicAccessConfiguration
instance
Prelude.NFData
BlockPublicAccessConfiguration
instance Core.ToJSON BlockPublicAccessConfiguration where
toJSON :: BlockPublicAccessConfiguration -> Value
toJSON BlockPublicAccessConfiguration' {Bool
Maybe [PortRange]
blockPublicSecurityGroupRules :: Bool
permittedPublicSecurityGroupRuleRanges :: Maybe [PortRange]
$sel:blockPublicSecurityGroupRules:BlockPublicAccessConfiguration' :: BlockPublicAccessConfiguration -> Bool
$sel:permittedPublicSecurityGroupRuleRanges:BlockPublicAccessConfiguration' :: BlockPublicAccessConfiguration -> Maybe [PortRange]
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"PermittedPublicSecurityGroupRuleRanges" Text -> [PortRange] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
([PortRange] -> Pair) -> Maybe [PortRange] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [PortRange]
permittedPublicSecurityGroupRuleRanges,
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"BlockPublicSecurityGroupRules"
Text -> Bool -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Bool
blockPublicSecurityGroupRules
)
]
)