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

-- | 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.
--
-- Returned by ListRegexPatternSets. Each @RegexPatternSetSummary@ object
-- includes the @Name@ and @RegexPatternSetId@ for one RegexPatternSet.
--
-- /See:/ 'newRegexPatternSetSummary' smart constructor.
data RegexPatternSetSummary = RegexPatternSetSummary'
  { -- | The @RegexPatternSetId@ for a @RegexPatternSet@. You use
    -- @RegexPatternSetId@ to get information about a @RegexPatternSet@, update
    -- a @RegexPatternSet@, remove a @RegexPatternSet@ from a @RegexMatchSet@,
    -- and delete a @RegexPatternSet@ from AWS WAF.
    --
    -- @RegexPatternSetId@ is returned by CreateRegexPatternSet and by
    -- ListRegexPatternSets.
    RegexPatternSetSummary -> Text
regexPatternSetId :: Prelude.Text,
    -- | A friendly name or description of the RegexPatternSet. You can\'t change
    -- @Name@ after you create a @RegexPatternSet@.
    RegexPatternSetSummary -> Text
name :: Prelude.Text
  }
  deriving (RegexPatternSetSummary -> RegexPatternSetSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RegexPatternSetSummary -> RegexPatternSetSummary -> Bool
$c/= :: RegexPatternSetSummary -> RegexPatternSetSummary -> Bool
== :: RegexPatternSetSummary -> RegexPatternSetSummary -> Bool
$c== :: RegexPatternSetSummary -> RegexPatternSetSummary -> Bool
Prelude.Eq, ReadPrec [RegexPatternSetSummary]
ReadPrec RegexPatternSetSummary
Int -> ReadS RegexPatternSetSummary
ReadS [RegexPatternSetSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RegexPatternSetSummary]
$creadListPrec :: ReadPrec [RegexPatternSetSummary]
readPrec :: ReadPrec RegexPatternSetSummary
$creadPrec :: ReadPrec RegexPatternSetSummary
readList :: ReadS [RegexPatternSetSummary]
$creadList :: ReadS [RegexPatternSetSummary]
readsPrec :: Int -> ReadS RegexPatternSetSummary
$creadsPrec :: Int -> ReadS RegexPatternSetSummary
Prelude.Read, Int -> RegexPatternSetSummary -> ShowS
[RegexPatternSetSummary] -> ShowS
RegexPatternSetSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RegexPatternSetSummary] -> ShowS
$cshowList :: [RegexPatternSetSummary] -> ShowS
show :: RegexPatternSetSummary -> String
$cshow :: RegexPatternSetSummary -> String
showsPrec :: Int -> RegexPatternSetSummary -> ShowS
$cshowsPrec :: Int -> RegexPatternSetSummary -> ShowS
Prelude.Show, forall x. Rep RegexPatternSetSummary x -> RegexPatternSetSummary
forall x. RegexPatternSetSummary -> Rep RegexPatternSetSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RegexPatternSetSummary x -> RegexPatternSetSummary
$cfrom :: forall x. RegexPatternSetSummary -> Rep RegexPatternSetSummary x
Prelude.Generic)

-- |
-- Create a value of 'RegexPatternSetSummary' 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:
--
-- 'regexPatternSetId', 'regexPatternSetSummary_regexPatternSetId' - The @RegexPatternSetId@ for a @RegexPatternSet@. You use
-- @RegexPatternSetId@ to get information about a @RegexPatternSet@, update
-- a @RegexPatternSet@, remove a @RegexPatternSet@ from a @RegexMatchSet@,
-- and delete a @RegexPatternSet@ from AWS WAF.
--
-- @RegexPatternSetId@ is returned by CreateRegexPatternSet and by
-- ListRegexPatternSets.
--
-- 'name', 'regexPatternSetSummary_name' - A friendly name or description of the RegexPatternSet. You can\'t change
-- @Name@ after you create a @RegexPatternSet@.
newRegexPatternSetSummary ::
  -- | 'regexPatternSetId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  RegexPatternSetSummary
newRegexPatternSetSummary :: Text -> Text -> RegexPatternSetSummary
newRegexPatternSetSummary Text
pRegexPatternSetId_ Text
pName_ =
  RegexPatternSetSummary'
    { $sel:regexPatternSetId:RegexPatternSetSummary' :: Text
regexPatternSetId =
        Text
pRegexPatternSetId_,
      $sel:name:RegexPatternSetSummary' :: Text
name = Text
pName_
    }

-- | The @RegexPatternSetId@ for a @RegexPatternSet@. You use
-- @RegexPatternSetId@ to get information about a @RegexPatternSet@, update
-- a @RegexPatternSet@, remove a @RegexPatternSet@ from a @RegexMatchSet@,
-- and delete a @RegexPatternSet@ from AWS WAF.
--
-- @RegexPatternSetId@ is returned by CreateRegexPatternSet and by
-- ListRegexPatternSets.
regexPatternSetSummary_regexPatternSetId :: Lens.Lens' RegexPatternSetSummary Prelude.Text
regexPatternSetSummary_regexPatternSetId :: Lens' RegexPatternSetSummary Text
regexPatternSetSummary_regexPatternSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexPatternSetSummary' {Text
regexPatternSetId :: Text
$sel:regexPatternSetId:RegexPatternSetSummary' :: RegexPatternSetSummary -> Text
regexPatternSetId} -> Text
regexPatternSetId) (\s :: RegexPatternSetSummary
s@RegexPatternSetSummary' {} Text
a -> RegexPatternSetSummary
s {$sel:regexPatternSetId:RegexPatternSetSummary' :: Text
regexPatternSetId = Text
a} :: RegexPatternSetSummary)

-- | A friendly name or description of the RegexPatternSet. You can\'t change
-- @Name@ after you create a @RegexPatternSet@.
regexPatternSetSummary_name :: Lens.Lens' RegexPatternSetSummary Prelude.Text
regexPatternSetSummary_name :: Lens' RegexPatternSetSummary Text
regexPatternSetSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexPatternSetSummary' {Text
name :: Text
$sel:name:RegexPatternSetSummary' :: RegexPatternSetSummary -> Text
name} -> Text
name) (\s :: RegexPatternSetSummary
s@RegexPatternSetSummary' {} Text
a -> RegexPatternSetSummary
s {$sel:name:RegexPatternSetSummary' :: Text
name = Text
a} :: RegexPatternSetSummary)

instance Data.FromJSON RegexPatternSetSummary where
  parseJSON :: Value -> Parser RegexPatternSetSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RegexPatternSetSummary"
      ( \Object
x ->
          Text -> Text -> RegexPatternSetSummary
RegexPatternSetSummary'
            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
"RegexPatternSetId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"Name")
      )

instance Prelude.Hashable RegexPatternSetSummary where
  hashWithSalt :: Int -> RegexPatternSetSummary -> Int
hashWithSalt Int
_salt RegexPatternSetSummary' {Text
name :: Text
regexPatternSetId :: Text
$sel:name:RegexPatternSetSummary' :: RegexPatternSetSummary -> Text
$sel:regexPatternSetId:RegexPatternSetSummary' :: RegexPatternSetSummary -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
regexPatternSetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

instance Prelude.NFData RegexPatternSetSummary where
  rnf :: RegexPatternSetSummary -> ()
rnf RegexPatternSetSummary' {Text
name :: Text
regexPatternSetId :: Text
$sel:name:RegexPatternSetSummary' :: RegexPatternSetSummary -> Text
$sel:regexPatternSetId:RegexPatternSetSummary' :: RegexPatternSetSummary -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
regexPatternSetId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
name