{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.Shield.Types.ProtectionGroupLimits
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | Limits settings on protection groups for your subscription.
--
-- /See:/ 'newProtectionGroupLimits' smart constructor.
data ProtectionGroupLimits = ProtectionGroupLimits'
  { -- | The maximum number of protection groups that you can have at one time.
    ProtectionGroupLimits -> Integer
maxProtectionGroups :: Prelude.Integer,
    -- | Limits settings by pattern type in the protection groups for your
    -- subscription.
    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)

-- |
-- Create a value of 'ProtectionGroupLimits' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'maxProtectionGroups', 'protectionGroupLimits_maxProtectionGroups' - The maximum number of protection groups that you can have at one time.
--
-- 'patternTypeLimits', 'protectionGroupLimits_patternTypeLimits' - Limits settings by pattern type in the protection groups for your
-- subscription.
newProtectionGroupLimits ::
  -- | 'maxProtectionGroups'
  Prelude.Integer ->
  -- | 'patternTypeLimits'
  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_
      }

-- | The maximum number of protection groups that you can have at one time.
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)

-- | Limits settings by pattern type in the protection groups for your
-- subscription.
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