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

-- |
-- Create a value of 'RegexMatchSetSummary' 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:
--
-- 'regexMatchSetId', 'regexMatchSetSummary_regexMatchSetId' - The @RegexMatchSetId@ for a @RegexMatchSet@. You use @RegexMatchSetId@
-- to get information about a @RegexMatchSet@, update a @RegexMatchSet@,
-- remove a @RegexMatchSet@ from a @Rule@, and delete a @RegexMatchSet@
-- from AWS WAF.
--
-- @RegexMatchSetId@ is returned by CreateRegexMatchSet and by
-- ListRegexMatchSets.
--
-- 'name', 'regexMatchSetSummary_name' - A friendly name or description of the RegexMatchSet. You can\'t change
-- @Name@ after you create a @RegexMatchSet@.
newRegexMatchSetSummary ::
  -- | 'regexMatchSetId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  RegexMatchSetSummary
newRegexMatchSetSummary :: Text -> Text -> RegexMatchSetSummary
newRegexMatchSetSummary Text
pRegexMatchSetId_ Text
pName_ =
  RegexMatchSetSummary'
    { $sel:regexMatchSetId:RegexMatchSetSummary' :: Text
regexMatchSetId =
        Text
pRegexMatchSetId_,
      $sel:name:RegexMatchSetSummary' :: Text
name = Text
pName_
    }

-- | The @RegexMatchSetId@ for a @RegexMatchSet@. You use @RegexMatchSetId@
-- to get information about a @RegexMatchSet@, update a @RegexMatchSet@,
-- remove a @RegexMatchSet@ from a @Rule@, and delete a @RegexMatchSet@
-- from AWS WAF.
--
-- @RegexMatchSetId@ is returned by CreateRegexMatchSet and by
-- ListRegexMatchSets.
regexMatchSetSummary_regexMatchSetId :: Lens.Lens' RegexMatchSetSummary Prelude.Text
regexMatchSetSummary_regexMatchSetId :: Lens' RegexMatchSetSummary Text
regexMatchSetSummary_regexMatchSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RegexMatchSetSummary' {Text
regexMatchSetId :: Text
$sel:regexMatchSetId:RegexMatchSetSummary' :: RegexMatchSetSummary -> Text
regexMatchSetId} -> Text
regexMatchSetId) (\s :: RegexMatchSetSummary
s@RegexMatchSetSummary' {} Text
a -> RegexMatchSetSummary
s {$sel:regexMatchSetId:RegexMatchSetSummary' :: Text
regexMatchSetId = Text
a} :: RegexMatchSetSummary)

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

instance Data.FromJSON RegexMatchSetSummary where
  parseJSON :: Value -> Parser RegexMatchSetSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RegexMatchSetSummary"
      ( \Object
x ->
          Text -> Text -> RegexMatchSetSummary
RegexMatchSetSummary'
            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
"RegexMatchSetId")
            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 RegexMatchSetSummary where
  hashWithSalt :: Int -> RegexMatchSetSummary -> Int
hashWithSalt Int
_salt RegexMatchSetSummary' {Text
name :: Text
regexMatchSetId :: Text
$sel:name:RegexMatchSetSummary' :: RegexMatchSetSummary -> Text
$sel:regexMatchSetId:RegexMatchSetSummary' :: RegexMatchSetSummary -> Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
regexMatchSetId
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
name

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