{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.Shield.Types.ProtectionGroupArbitraryPatternLimits where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
    { $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 :: Lens' ProtectionGroupArbitraryPatternLimits Integer
protectionGroupArbitraryPatternLimits_maxMembers = 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
  Data.FromJSON
    ProtectionGroupArbitraryPatternLimits
  where
  parseJSON :: Value -> Parser ProtectionGroupArbitraryPatternLimits
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ProtectionGroupArbitraryPatternLimits"
      ( \Object
x ->
          Integer -> ProtectionGroupArbitraryPatternLimits
ProtectionGroupArbitraryPatternLimits'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"MaxMembers")
      )

instance
  Prelude.Hashable
    ProtectionGroupArbitraryPatternLimits
  where
  hashWithSalt :: Int -> ProtectionGroupArbitraryPatternLimits -> Int
hashWithSalt
    Int
_salt
    ProtectionGroupArbitraryPatternLimits' {Integer
maxMembers :: Integer
$sel:maxMembers:ProtectionGroupArbitraryPatternLimits' :: ProtectionGroupArbitraryPatternLimits -> Integer
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Integer
maxMembers

instance
  Prelude.NFData
    ProtectionGroupArbitraryPatternLimits
  where
  rnf :: ProtectionGroupArbitraryPatternLimits -> ()
rnf ProtectionGroupArbitraryPatternLimits' {Integer
maxMembers :: Integer
$sel:maxMembers:ProtectionGroupArbitraryPatternLimits' :: ProtectionGroupArbitraryPatternLimits -> Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Integer
maxMembers