{-# 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.ProtectionGroupArbitraryPatternLimits
-- 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.ProtectionGroupArbitraryPatternLimits where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Limits settings on protection groups with arbitrary pattern type.
--
-- /See:/ 'newProtectionGroupArbitraryPatternLimits' smart constructor.
data ProtectionGroupArbitraryPatternLimits = ProtectionGroupArbitraryPatternLimits'
  { -- | The maximum number of resources you can specify for a single arbitrary
    -- pattern in a protection group.
    ProtectionGroupArbitraryPatternLimits -> Integer
maxMembers :: Prelude.Integer
  }
  deriving (ProtectionGroupArbitraryPatternLimits
-> ProtectionGroupArbitraryPatternLimits -> Bool
(ProtectionGroupArbitraryPatternLimits
 -> ProtectionGroupArbitraryPatternLimits -> Bool)
-> (ProtectionGroupArbitraryPatternLimits
    -> ProtectionGroupArbitraryPatternLimits -> Bool)
-> Eq ProtectionGroupArbitraryPatternLimits
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProtectionGroupArbitraryPatternLimits
-> ProtectionGroupArbitraryPatternLimits -> Bool
$c/= :: ProtectionGroupArbitraryPatternLimits
-> ProtectionGroupArbitraryPatternLimits -> Bool
== :: ProtectionGroupArbitraryPatternLimits
-> ProtectionGroupArbitraryPatternLimits -> Bool
$c== :: ProtectionGroupArbitraryPatternLimits
-> ProtectionGroupArbitraryPatternLimits -> Bool
Prelude.Eq, ReadPrec [ProtectionGroupArbitraryPatternLimits]
ReadPrec ProtectionGroupArbitraryPatternLimits
Int -> ReadS ProtectionGroupArbitraryPatternLimits
ReadS [ProtectionGroupArbitraryPatternLimits]
(Int -> ReadS ProtectionGroupArbitraryPatternLimits)
-> ReadS [ProtectionGroupArbitraryPatternLimits]
-> ReadPrec ProtectionGroupArbitraryPatternLimits
-> ReadPrec [ProtectionGroupArbitraryPatternLimits]
-> Read ProtectionGroupArbitraryPatternLimits
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProtectionGroupArbitraryPatternLimits]
$creadListPrec :: ReadPrec [ProtectionGroupArbitraryPatternLimits]
readPrec :: ReadPrec ProtectionGroupArbitraryPatternLimits
$creadPrec :: ReadPrec ProtectionGroupArbitraryPatternLimits
readList :: ReadS [ProtectionGroupArbitraryPatternLimits]
$creadList :: ReadS [ProtectionGroupArbitraryPatternLimits]
readsPrec :: Int -> ReadS ProtectionGroupArbitraryPatternLimits
$creadsPrec :: Int -> ReadS ProtectionGroupArbitraryPatternLimits
Prelude.Read, Int -> ProtectionGroupArbitraryPatternLimits -> ShowS
[ProtectionGroupArbitraryPatternLimits] -> ShowS
ProtectionGroupArbitraryPatternLimits -> String
(Int -> ProtectionGroupArbitraryPatternLimits -> ShowS)
-> (ProtectionGroupArbitraryPatternLimits -> String)
-> ([ProtectionGroupArbitraryPatternLimits] -> ShowS)
-> Show ProtectionGroupArbitraryPatternLimits
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProtectionGroupArbitraryPatternLimits] -> ShowS
$cshowList :: [ProtectionGroupArbitraryPatternLimits] -> ShowS
show :: ProtectionGroupArbitraryPatternLimits -> String
$cshow :: ProtectionGroupArbitraryPatternLimits -> String
showsPrec :: Int -> ProtectionGroupArbitraryPatternLimits -> ShowS
$cshowsPrec :: Int -> ProtectionGroupArbitraryPatternLimits -> ShowS
Prelude.Show, (forall x.
 ProtectionGroupArbitraryPatternLimits
 -> Rep ProtectionGroupArbitraryPatternLimits x)
-> (forall x.
    Rep ProtectionGroupArbitraryPatternLimits x
    -> ProtectionGroupArbitraryPatternLimits)
-> Generic ProtectionGroupArbitraryPatternLimits
forall x.
Rep ProtectionGroupArbitraryPatternLimits x
-> ProtectionGroupArbitraryPatternLimits
forall x.
ProtectionGroupArbitraryPatternLimits
-> Rep ProtectionGroupArbitraryPatternLimits x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProtectionGroupArbitraryPatternLimits x
-> ProtectionGroupArbitraryPatternLimits
$cfrom :: forall x.
ProtectionGroupArbitraryPatternLimits
-> Rep ProtectionGroupArbitraryPatternLimits x
Prelude.Generic)

-- |
-- Create a value of 'ProtectionGroupArbitraryPatternLimits' 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:
--
-- 'maxMembers', 'protectionGroupArbitraryPatternLimits_maxMembers' - The maximum number of resources you can specify for a single arbitrary
-- pattern in a protection group.
newProtectionGroupArbitraryPatternLimits ::
  -- | 'maxMembers'
  Prelude.Integer ->
  ProtectionGroupArbitraryPatternLimits
newProtectionGroupArbitraryPatternLimits :: Integer -> ProtectionGroupArbitraryPatternLimits
newProtectionGroupArbitraryPatternLimits Integer
pMaxMembers_ =
  ProtectionGroupArbitraryPatternLimits' :: Integer -> ProtectionGroupArbitraryPatternLimits
ProtectionGroupArbitraryPatternLimits'
    { $sel:maxMembers:ProtectionGroupArbitraryPatternLimits' :: Integer
maxMembers =
        Integer
pMaxMembers_
    }

-- | The maximum number of resources you can specify for a single arbitrary
-- pattern in a protection group.
protectionGroupArbitraryPatternLimits_maxMembers :: Lens.Lens' ProtectionGroupArbitraryPatternLimits Prelude.Integer
protectionGroupArbitraryPatternLimits_maxMembers :: (Integer -> f Integer)
-> ProtectionGroupArbitraryPatternLimits
-> f ProtectionGroupArbitraryPatternLimits
protectionGroupArbitraryPatternLimits_maxMembers = (ProtectionGroupArbitraryPatternLimits -> Integer)
-> (ProtectionGroupArbitraryPatternLimits
    -> Integer -> ProtectionGroupArbitraryPatternLimits)
-> Lens
     ProtectionGroupArbitraryPatternLimits
     ProtectionGroupArbitraryPatternLimits
     Integer
     Integer
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtectionGroupArbitraryPatternLimits' {Integer
maxMembers :: Integer
$sel:maxMembers:ProtectionGroupArbitraryPatternLimits' :: ProtectionGroupArbitraryPatternLimits -> Integer
maxMembers} -> Integer
maxMembers) (\s :: ProtectionGroupArbitraryPatternLimits
s@ProtectionGroupArbitraryPatternLimits' {} Integer
a -> ProtectionGroupArbitraryPatternLimits
s {$sel:maxMembers:ProtectionGroupArbitraryPatternLimits' :: Integer
maxMembers = Integer
a} :: ProtectionGroupArbitraryPatternLimits)

instance
  Core.FromJSON
    ProtectionGroupArbitraryPatternLimits
  where
  parseJSON :: Value -> Parser ProtectionGroupArbitraryPatternLimits
parseJSON =
    String
-> (Object -> Parser ProtectionGroupArbitraryPatternLimits)
-> Value
-> Parser ProtectionGroupArbitraryPatternLimits
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ProtectionGroupArbitraryPatternLimits"
      ( \Object
x ->
          Integer -> ProtectionGroupArbitraryPatternLimits
ProtectionGroupArbitraryPatternLimits'
            (Integer -> ProtectionGroupArbitraryPatternLimits)
-> Parser Integer -> Parser ProtectionGroupArbitraryPatternLimits
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
"MaxMembers")
      )

instance
  Prelude.Hashable
    ProtectionGroupArbitraryPatternLimits

instance
  Prelude.NFData
    ProtectionGroupArbitraryPatternLimits