{-# 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.WAF.Types.SizeConstraintSetSummary
-- 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.WAF.Types.SizeConstraintSetSummary where

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

-- | This is __AWS WAF Classic__ documentation. For more information, see
-- <https://docs.aws.amazon.com/waf/latest/developerguide/classic-waf-chapter.html AWS WAF Classic>
-- in the developer guide.
--
-- __For the latest version of AWS WAF__, use the AWS WAFV2 API and see the
-- <https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html AWS WAF Developer Guide>.
-- With the latest version, AWS WAF has a single set of endpoints for
-- regional and global use.
--
-- The @Id@ and @Name@ of a @SizeConstraintSet@.
--
-- /See:/ 'newSizeConstraintSetSummary' smart constructor.
data SizeConstraintSetSummary = SizeConstraintSetSummary'
  { -- | A unique identifier for a @SizeConstraintSet@. You use
    -- @SizeConstraintSetId@ to get information about a @SizeConstraintSet@
    -- (see GetSizeConstraintSet), update a @SizeConstraintSet@ (see
    -- UpdateSizeConstraintSet), insert a @SizeConstraintSet@ into a @Rule@ or
    -- delete one from a @Rule@ (see UpdateRule), and delete a
    -- @SizeConstraintSet@ from AWS WAF (see DeleteSizeConstraintSet).
    --
    -- @SizeConstraintSetId@ is returned by CreateSizeConstraintSet and by
    -- ListSizeConstraintSets.
    SizeConstraintSetSummary -> Text
sizeConstraintSetId :: Prelude.Text,
    -- | The name of the @SizeConstraintSet@, if any.
    SizeConstraintSetSummary -> Text
name :: Prelude.Text
  }
  deriving (SizeConstraintSetSummary -> SizeConstraintSetSummary -> Bool
(SizeConstraintSetSummary -> SizeConstraintSetSummary -> Bool)
-> (SizeConstraintSetSummary -> SizeConstraintSetSummary -> Bool)
-> Eq SizeConstraintSetSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SizeConstraintSetSummary -> SizeConstraintSetSummary -> Bool
$c/= :: SizeConstraintSetSummary -> SizeConstraintSetSummary -> Bool
== :: SizeConstraintSetSummary -> SizeConstraintSetSummary -> Bool
$c== :: SizeConstraintSetSummary -> SizeConstraintSetSummary -> Bool
Prelude.Eq, ReadPrec [SizeConstraintSetSummary]
ReadPrec SizeConstraintSetSummary
Int -> ReadS SizeConstraintSetSummary
ReadS [SizeConstraintSetSummary]
(Int -> ReadS SizeConstraintSetSummary)
-> ReadS [SizeConstraintSetSummary]
-> ReadPrec SizeConstraintSetSummary
-> ReadPrec [SizeConstraintSetSummary]
-> Read SizeConstraintSetSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SizeConstraintSetSummary]
$creadListPrec :: ReadPrec [SizeConstraintSetSummary]
readPrec :: ReadPrec SizeConstraintSetSummary
$creadPrec :: ReadPrec SizeConstraintSetSummary
readList :: ReadS [SizeConstraintSetSummary]
$creadList :: ReadS [SizeConstraintSetSummary]
readsPrec :: Int -> ReadS SizeConstraintSetSummary
$creadsPrec :: Int -> ReadS SizeConstraintSetSummary
Prelude.Read, Int -> SizeConstraintSetSummary -> ShowS
[SizeConstraintSetSummary] -> ShowS
SizeConstraintSetSummary -> String
(Int -> SizeConstraintSetSummary -> ShowS)
-> (SizeConstraintSetSummary -> String)
-> ([SizeConstraintSetSummary] -> ShowS)
-> Show SizeConstraintSetSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SizeConstraintSetSummary] -> ShowS
$cshowList :: [SizeConstraintSetSummary] -> ShowS
show :: SizeConstraintSetSummary -> String
$cshow :: SizeConstraintSetSummary -> String
showsPrec :: Int -> SizeConstraintSetSummary -> ShowS
$cshowsPrec :: Int -> SizeConstraintSetSummary -> ShowS
Prelude.Show, (forall x.
 SizeConstraintSetSummary -> Rep SizeConstraintSetSummary x)
-> (forall x.
    Rep SizeConstraintSetSummary x -> SizeConstraintSetSummary)
-> Generic SizeConstraintSetSummary
forall x.
Rep SizeConstraintSetSummary x -> SizeConstraintSetSummary
forall x.
SizeConstraintSetSummary -> Rep SizeConstraintSetSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SizeConstraintSetSummary x -> SizeConstraintSetSummary
$cfrom :: forall x.
SizeConstraintSetSummary -> Rep SizeConstraintSetSummary x
Prelude.Generic)

-- |
-- Create a value of 'SizeConstraintSetSummary' 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:
--
-- 'sizeConstraintSetId', 'sizeConstraintSetSummary_sizeConstraintSetId' - A unique identifier for a @SizeConstraintSet@. You use
-- @SizeConstraintSetId@ to get information about a @SizeConstraintSet@
-- (see GetSizeConstraintSet), update a @SizeConstraintSet@ (see
-- UpdateSizeConstraintSet), insert a @SizeConstraintSet@ into a @Rule@ or
-- delete one from a @Rule@ (see UpdateRule), and delete a
-- @SizeConstraintSet@ from AWS WAF (see DeleteSizeConstraintSet).
--
-- @SizeConstraintSetId@ is returned by CreateSizeConstraintSet and by
-- ListSizeConstraintSets.
--
-- 'name', 'sizeConstraintSetSummary_name' - The name of the @SizeConstraintSet@, if any.
newSizeConstraintSetSummary ::
  -- | 'sizeConstraintSetId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  SizeConstraintSetSummary
newSizeConstraintSetSummary :: Text -> Text -> SizeConstraintSetSummary
newSizeConstraintSetSummary
  Text
pSizeConstraintSetId_
  Text
pName_ =
    SizeConstraintSetSummary' :: Text -> Text -> SizeConstraintSetSummary
SizeConstraintSetSummary'
      { $sel:sizeConstraintSetId:SizeConstraintSetSummary' :: Text
sizeConstraintSetId =
          Text
pSizeConstraintSetId_,
        $sel:name:SizeConstraintSetSummary' :: Text
name = Text
pName_
      }

-- | A unique identifier for a @SizeConstraintSet@. You use
-- @SizeConstraintSetId@ to get information about a @SizeConstraintSet@
-- (see GetSizeConstraintSet), update a @SizeConstraintSet@ (see
-- UpdateSizeConstraintSet), insert a @SizeConstraintSet@ into a @Rule@ or
-- delete one from a @Rule@ (see UpdateRule), and delete a
-- @SizeConstraintSet@ from AWS WAF (see DeleteSizeConstraintSet).
--
-- @SizeConstraintSetId@ is returned by CreateSizeConstraintSet and by
-- ListSizeConstraintSets.
sizeConstraintSetSummary_sizeConstraintSetId :: Lens.Lens' SizeConstraintSetSummary Prelude.Text
sizeConstraintSetSummary_sizeConstraintSetId :: (Text -> f Text)
-> SizeConstraintSetSummary -> f SizeConstraintSetSummary
sizeConstraintSetSummary_sizeConstraintSetId = (SizeConstraintSetSummary -> Text)
-> (SizeConstraintSetSummary -> Text -> SizeConstraintSetSummary)
-> Lens SizeConstraintSetSummary SizeConstraintSetSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SizeConstraintSetSummary' {Text
sizeConstraintSetId :: Text
$sel:sizeConstraintSetId:SizeConstraintSetSummary' :: SizeConstraintSetSummary -> Text
sizeConstraintSetId} -> Text
sizeConstraintSetId) (\s :: SizeConstraintSetSummary
s@SizeConstraintSetSummary' {} Text
a -> SizeConstraintSetSummary
s {$sel:sizeConstraintSetId:SizeConstraintSetSummary' :: Text
sizeConstraintSetId = Text
a} :: SizeConstraintSetSummary)

-- | The name of the @SizeConstraintSet@, if any.
sizeConstraintSetSummary_name :: Lens.Lens' SizeConstraintSetSummary Prelude.Text
sizeConstraintSetSummary_name :: (Text -> f Text)
-> SizeConstraintSetSummary -> f SizeConstraintSetSummary
sizeConstraintSetSummary_name = (SizeConstraintSetSummary -> Text)
-> (SizeConstraintSetSummary -> Text -> SizeConstraintSetSummary)
-> Lens SizeConstraintSetSummary SizeConstraintSetSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SizeConstraintSetSummary' {Text
name :: Text
$sel:name:SizeConstraintSetSummary' :: SizeConstraintSetSummary -> Text
name} -> Text
name) (\s :: SizeConstraintSetSummary
s@SizeConstraintSetSummary' {} Text
a -> SizeConstraintSetSummary
s {$sel:name:SizeConstraintSetSummary' :: Text
name = Text
a} :: SizeConstraintSetSummary)

instance Core.FromJSON SizeConstraintSetSummary where
  parseJSON :: Value -> Parser SizeConstraintSetSummary
parseJSON =
    String
-> (Object -> Parser SizeConstraintSetSummary)
-> Value
-> Parser SizeConstraintSetSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SizeConstraintSetSummary"
      ( \Object
x ->
          Text -> Text -> SizeConstraintSetSummary
SizeConstraintSetSummary'
            (Text -> Text -> SizeConstraintSetSummary)
-> Parser Text -> Parser (Text -> SizeConstraintSetSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SizeConstraintSetId")
            Parser (Text -> SizeConstraintSetSummary)
-> Parser Text -> Parser SizeConstraintSetSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Name")
      )

instance Prelude.Hashable SizeConstraintSetSummary

instance Prelude.NFData SizeConstraintSetSummary