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

instance Prelude.NFData RegexMatchSetSummary