{-# 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.Shield.Types.ProtectionGroupLimits where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Shield.Types.ProtectionGroupPatternTypeLimits
data ProtectionGroupLimits = ProtectionGroupLimits'
{
ProtectionGroupLimits -> Integer
maxProtectionGroups :: Prelude.Integer,
ProtectionGroupLimits -> ProtectionGroupPatternTypeLimits
patternTypeLimits :: ProtectionGroupPatternTypeLimits
}
deriving (ProtectionGroupLimits -> ProtectionGroupLimits -> Bool
(ProtectionGroupLimits -> ProtectionGroupLimits -> Bool)
-> (ProtectionGroupLimits -> ProtectionGroupLimits -> Bool)
-> Eq ProtectionGroupLimits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProtectionGroupLimits -> ProtectionGroupLimits -> Bool
$c/= :: ProtectionGroupLimits -> ProtectionGroupLimits -> Bool
== :: ProtectionGroupLimits -> ProtectionGroupLimits -> Bool
$c== :: ProtectionGroupLimits -> ProtectionGroupLimits -> Bool
Prelude.Eq, ReadPrec [ProtectionGroupLimits]
ReadPrec ProtectionGroupLimits
Int -> ReadS ProtectionGroupLimits
ReadS [ProtectionGroupLimits]
(Int -> ReadS ProtectionGroupLimits)
-> ReadS [ProtectionGroupLimits]
-> ReadPrec ProtectionGroupLimits
-> ReadPrec [ProtectionGroupLimits]
-> Read ProtectionGroupLimits
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProtectionGroupLimits]
$creadListPrec :: ReadPrec [ProtectionGroupLimits]
readPrec :: ReadPrec ProtectionGroupLimits
$creadPrec :: ReadPrec ProtectionGroupLimits
readList :: ReadS [ProtectionGroupLimits]
$creadList :: ReadS [ProtectionGroupLimits]
readsPrec :: Int -> ReadS ProtectionGroupLimits
$creadsPrec :: Int -> ReadS ProtectionGroupLimits
Prelude.Read, Int -> ProtectionGroupLimits -> ShowS
[ProtectionGroupLimits] -> ShowS
ProtectionGroupLimits -> String
(Int -> ProtectionGroupLimits -> ShowS)
-> (ProtectionGroupLimits -> String)
-> ([ProtectionGroupLimits] -> ShowS)
-> Show ProtectionGroupLimits
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProtectionGroupLimits] -> ShowS
$cshowList :: [ProtectionGroupLimits] -> ShowS
show :: ProtectionGroupLimits -> String
$cshow :: ProtectionGroupLimits -> String
showsPrec :: Int -> ProtectionGroupLimits -> ShowS
$cshowsPrec :: Int -> ProtectionGroupLimits -> ShowS
Prelude.Show, (forall x. ProtectionGroupLimits -> Rep ProtectionGroupLimits x)
-> (forall x. Rep ProtectionGroupLimits x -> ProtectionGroupLimits)
-> Generic ProtectionGroupLimits
forall x. Rep ProtectionGroupLimits x -> ProtectionGroupLimits
forall x. ProtectionGroupLimits -> Rep ProtectionGroupLimits x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ProtectionGroupLimits x -> ProtectionGroupLimits
$cfrom :: forall x. ProtectionGroupLimits -> Rep ProtectionGroupLimits x
Prelude.Generic)
newProtectionGroupLimits ::
Prelude.Integer ->
ProtectionGroupPatternTypeLimits ->
ProtectionGroupLimits
newProtectionGroupLimits :: Integer
-> ProtectionGroupPatternTypeLimits -> ProtectionGroupLimits
newProtectionGroupLimits
Integer
pMaxProtectionGroups_
ProtectionGroupPatternTypeLimits
pPatternTypeLimits_ =
ProtectionGroupLimits' :: Integer
-> ProtectionGroupPatternTypeLimits -> ProtectionGroupLimits
ProtectionGroupLimits'
{ $sel:maxProtectionGroups:ProtectionGroupLimits' :: Integer
maxProtectionGroups =
Integer
pMaxProtectionGroups_,
$sel:patternTypeLimits:ProtectionGroupLimits' :: ProtectionGroupPatternTypeLimits
patternTypeLimits = ProtectionGroupPatternTypeLimits
pPatternTypeLimits_
}
protectionGroupLimits_maxProtectionGroups :: Lens.Lens' ProtectionGroupLimits Prelude.Integer
protectionGroupLimits_maxProtectionGroups :: (Integer -> f Integer)
-> ProtectionGroupLimits -> f ProtectionGroupLimits
protectionGroupLimits_maxProtectionGroups = (ProtectionGroupLimits -> Integer)
-> (ProtectionGroupLimits -> Integer -> ProtectionGroupLimits)
-> Lens ProtectionGroupLimits ProtectionGroupLimits Integer Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtectionGroupLimits' {Integer
maxProtectionGroups :: Integer
$sel:maxProtectionGroups:ProtectionGroupLimits' :: ProtectionGroupLimits -> Integer
maxProtectionGroups} -> Integer
maxProtectionGroups) (\s :: ProtectionGroupLimits
s@ProtectionGroupLimits' {} Integer
a -> ProtectionGroupLimits
s {$sel:maxProtectionGroups:ProtectionGroupLimits' :: Integer
maxProtectionGroups = Integer
a} :: ProtectionGroupLimits)
protectionGroupLimits_patternTypeLimits :: Lens.Lens' ProtectionGroupLimits ProtectionGroupPatternTypeLimits
protectionGroupLimits_patternTypeLimits :: (ProtectionGroupPatternTypeLimits
-> f ProtectionGroupPatternTypeLimits)
-> ProtectionGroupLimits -> f ProtectionGroupLimits
protectionGroupLimits_patternTypeLimits = (ProtectionGroupLimits -> ProtectionGroupPatternTypeLimits)
-> (ProtectionGroupLimits
-> ProtectionGroupPatternTypeLimits -> ProtectionGroupLimits)
-> Lens
ProtectionGroupLimits
ProtectionGroupLimits
ProtectionGroupPatternTypeLimits
ProtectionGroupPatternTypeLimits
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtectionGroupLimits' {ProtectionGroupPatternTypeLimits
patternTypeLimits :: ProtectionGroupPatternTypeLimits
$sel:patternTypeLimits:ProtectionGroupLimits' :: ProtectionGroupLimits -> ProtectionGroupPatternTypeLimits
patternTypeLimits} -> ProtectionGroupPatternTypeLimits
patternTypeLimits) (\s :: ProtectionGroupLimits
s@ProtectionGroupLimits' {} ProtectionGroupPatternTypeLimits
a -> ProtectionGroupLimits
s {$sel:patternTypeLimits:ProtectionGroupLimits' :: ProtectionGroupPatternTypeLimits
patternTypeLimits = ProtectionGroupPatternTypeLimits
a} :: ProtectionGroupLimits)
instance Core.FromJSON ProtectionGroupLimits where
parseJSON :: Value -> Parser ProtectionGroupLimits
parseJSON =
String
-> (Object -> Parser ProtectionGroupLimits)
-> Value
-> Parser ProtectionGroupLimits
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ProtectionGroupLimits"
( \Object
x ->
Integer
-> ProtectionGroupPatternTypeLimits -> ProtectionGroupLimits
ProtectionGroupLimits'
(Integer
-> ProtectionGroupPatternTypeLimits -> ProtectionGroupLimits)
-> Parser Integer
-> Parser
(ProtectionGroupPatternTypeLimits -> ProtectionGroupLimits)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Integer
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"MaxProtectionGroups")
Parser (ProtectionGroupPatternTypeLimits -> ProtectionGroupLimits)
-> Parser ProtectionGroupPatternTypeLimits
-> Parser ProtectionGroupLimits
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser ProtectionGroupPatternTypeLimits
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"PatternTypeLimits")
)
instance Prelude.Hashable ProtectionGroupLimits
instance Prelude.NFData ProtectionGroupLimits