{-# 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.WAFRegional.Types.RegexPatternSetSummary
-- 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.WAFRegional.Types.RegexPatternSetSummary 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.
--
-- 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
(RegexPatternSetSummary -> RegexPatternSetSummary -> Bool)
-> (RegexPatternSetSummary -> RegexPatternSetSummary -> Bool)
-> Eq RegexPatternSetSummary
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]
(Int -> ReadS RegexPatternSetSummary)
-> ReadS [RegexPatternSetSummary]
-> ReadPrec RegexPatternSetSummary
-> ReadPrec [RegexPatternSetSummary]
-> Read 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
(Int -> RegexPatternSetSummary -> ShowS)
-> (RegexPatternSetSummary -> String)
-> ([RegexPatternSetSummary] -> ShowS)
-> Show RegexPatternSetSummary
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. RegexPatternSetSummary -> Rep RegexPatternSetSummary x)
-> (forall x.
    Rep RegexPatternSetSummary x -> RegexPatternSetSummary)
-> Generic RegexPatternSetSummary
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' :: Text -> Text -> RegexPatternSetSummary
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 :: (Text -> f Text)
-> RegexPatternSetSummary -> f RegexPatternSetSummary
regexPatternSetSummary_regexPatternSetId = (RegexPatternSetSummary -> Text)
-> (RegexPatternSetSummary -> Text -> RegexPatternSetSummary)
-> Lens RegexPatternSetSummary RegexPatternSetSummary Text Text
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 :: (Text -> f Text)
-> RegexPatternSetSummary -> f RegexPatternSetSummary
regexPatternSetSummary_name = (RegexPatternSetSummary -> Text)
-> (RegexPatternSetSummary -> Text -> RegexPatternSetSummary)
-> Lens RegexPatternSetSummary RegexPatternSetSummary Text Text
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 Core.FromJSON RegexPatternSetSummary where
  parseJSON :: Value -> Parser RegexPatternSetSummary
parseJSON =
    String
-> (Object -> Parser RegexPatternSetSummary)
-> Value
-> Parser RegexPatternSetSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RegexPatternSetSummary"
      ( \Object
x ->
          Text -> Text -> RegexPatternSetSummary
RegexPatternSetSummary'
            (Text -> Text -> RegexPatternSetSummary)
-> Parser Text -> Parser (Text -> RegexPatternSetSummary)
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
"RegexPatternSetId")
            Parser (Text -> RegexPatternSetSummary)
-> Parser Text -> Parser RegexPatternSetSummary
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 RegexPatternSetSummary

instance Prelude.NFData RegexPatternSetSummary