{-# 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.XssMatchSetSummary
-- 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.XssMatchSetSummary 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 an @XssMatchSet@.
--
-- /See:/ 'newXssMatchSetSummary' smart constructor.
data XssMatchSetSummary = XssMatchSetSummary'
  { -- | A unique identifier for an @XssMatchSet@. You use @XssMatchSetId@ to get
    -- information about a @XssMatchSet@ (see GetXssMatchSet), update an
    -- @XssMatchSet@ (see UpdateXssMatchSet), insert an @XssMatchSet@ into a
    -- @Rule@ or delete one from a @Rule@ (see UpdateRule), and delete an
    -- @XssMatchSet@ from AWS WAF (see DeleteXssMatchSet).
    --
    -- @XssMatchSetId@ is returned by CreateXssMatchSet and by
    -- ListXssMatchSets.
    XssMatchSetSummary -> Text
xssMatchSetId :: Prelude.Text,
    -- | The name of the @XssMatchSet@, if any, specified by @Id@.
    XssMatchSetSummary -> Text
name :: Prelude.Text
  }
  deriving (XssMatchSetSummary -> XssMatchSetSummary -> Bool
(XssMatchSetSummary -> XssMatchSetSummary -> Bool)
-> (XssMatchSetSummary -> XssMatchSetSummary -> Bool)
-> Eq XssMatchSetSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: XssMatchSetSummary -> XssMatchSetSummary -> Bool
$c/= :: XssMatchSetSummary -> XssMatchSetSummary -> Bool
== :: XssMatchSetSummary -> XssMatchSetSummary -> Bool
$c== :: XssMatchSetSummary -> XssMatchSetSummary -> Bool
Prelude.Eq, ReadPrec [XssMatchSetSummary]
ReadPrec XssMatchSetSummary
Int -> ReadS XssMatchSetSummary
ReadS [XssMatchSetSummary]
(Int -> ReadS XssMatchSetSummary)
-> ReadS [XssMatchSetSummary]
-> ReadPrec XssMatchSetSummary
-> ReadPrec [XssMatchSetSummary]
-> Read XssMatchSetSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [XssMatchSetSummary]
$creadListPrec :: ReadPrec [XssMatchSetSummary]
readPrec :: ReadPrec XssMatchSetSummary
$creadPrec :: ReadPrec XssMatchSetSummary
readList :: ReadS [XssMatchSetSummary]
$creadList :: ReadS [XssMatchSetSummary]
readsPrec :: Int -> ReadS XssMatchSetSummary
$creadsPrec :: Int -> ReadS XssMatchSetSummary
Prelude.Read, Int -> XssMatchSetSummary -> ShowS
[XssMatchSetSummary] -> ShowS
XssMatchSetSummary -> String
(Int -> XssMatchSetSummary -> ShowS)
-> (XssMatchSetSummary -> String)
-> ([XssMatchSetSummary] -> ShowS)
-> Show XssMatchSetSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [XssMatchSetSummary] -> ShowS
$cshowList :: [XssMatchSetSummary] -> ShowS
show :: XssMatchSetSummary -> String
$cshow :: XssMatchSetSummary -> String
showsPrec :: Int -> XssMatchSetSummary -> ShowS
$cshowsPrec :: Int -> XssMatchSetSummary -> ShowS
Prelude.Show, (forall x. XssMatchSetSummary -> Rep XssMatchSetSummary x)
-> (forall x. Rep XssMatchSetSummary x -> XssMatchSetSummary)
-> Generic XssMatchSetSummary
forall x. Rep XssMatchSetSummary x -> XssMatchSetSummary
forall x. XssMatchSetSummary -> Rep XssMatchSetSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep XssMatchSetSummary x -> XssMatchSetSummary
$cfrom :: forall x. XssMatchSetSummary -> Rep XssMatchSetSummary x
Prelude.Generic)

-- |
-- Create a value of 'XssMatchSetSummary' 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:
--
-- 'xssMatchSetId', 'xssMatchSetSummary_xssMatchSetId' - A unique identifier for an @XssMatchSet@. You use @XssMatchSetId@ to get
-- information about a @XssMatchSet@ (see GetXssMatchSet), update an
-- @XssMatchSet@ (see UpdateXssMatchSet), insert an @XssMatchSet@ into a
-- @Rule@ or delete one from a @Rule@ (see UpdateRule), and delete an
-- @XssMatchSet@ from AWS WAF (see DeleteXssMatchSet).
--
-- @XssMatchSetId@ is returned by CreateXssMatchSet and by
-- ListXssMatchSets.
--
-- 'name', 'xssMatchSetSummary_name' - The name of the @XssMatchSet@, if any, specified by @Id@.
newXssMatchSetSummary ::
  -- | 'xssMatchSetId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  XssMatchSetSummary
newXssMatchSetSummary :: Text -> Text -> XssMatchSetSummary
newXssMatchSetSummary Text
pXssMatchSetId_ Text
pName_ =
  XssMatchSetSummary' :: Text -> Text -> XssMatchSetSummary
XssMatchSetSummary'
    { $sel:xssMatchSetId:XssMatchSetSummary' :: Text
xssMatchSetId =
        Text
pXssMatchSetId_,
      $sel:name:XssMatchSetSummary' :: Text
name = Text
pName_
    }

-- | A unique identifier for an @XssMatchSet@. You use @XssMatchSetId@ to get
-- information about a @XssMatchSet@ (see GetXssMatchSet), update an
-- @XssMatchSet@ (see UpdateXssMatchSet), insert an @XssMatchSet@ into a
-- @Rule@ or delete one from a @Rule@ (see UpdateRule), and delete an
-- @XssMatchSet@ from AWS WAF (see DeleteXssMatchSet).
--
-- @XssMatchSetId@ is returned by CreateXssMatchSet and by
-- ListXssMatchSets.
xssMatchSetSummary_xssMatchSetId :: Lens.Lens' XssMatchSetSummary Prelude.Text
xssMatchSetSummary_xssMatchSetId :: (Text -> f Text) -> XssMatchSetSummary -> f XssMatchSetSummary
xssMatchSetSummary_xssMatchSetId = (XssMatchSetSummary -> Text)
-> (XssMatchSetSummary -> Text -> XssMatchSetSummary)
-> Lens XssMatchSetSummary XssMatchSetSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\XssMatchSetSummary' {Text
xssMatchSetId :: Text
$sel:xssMatchSetId:XssMatchSetSummary' :: XssMatchSetSummary -> Text
xssMatchSetId} -> Text
xssMatchSetId) (\s :: XssMatchSetSummary
s@XssMatchSetSummary' {} Text
a -> XssMatchSetSummary
s {$sel:xssMatchSetId:XssMatchSetSummary' :: Text
xssMatchSetId = Text
a} :: XssMatchSetSummary)

-- | The name of the @XssMatchSet@, if any, specified by @Id@.
xssMatchSetSummary_name :: Lens.Lens' XssMatchSetSummary Prelude.Text
xssMatchSetSummary_name :: (Text -> f Text) -> XssMatchSetSummary -> f XssMatchSetSummary
xssMatchSetSummary_name = (XssMatchSetSummary -> Text)
-> (XssMatchSetSummary -> Text -> XssMatchSetSummary)
-> Lens XssMatchSetSummary XssMatchSetSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\XssMatchSetSummary' {Text
name :: Text
$sel:name:XssMatchSetSummary' :: XssMatchSetSummary -> Text
name} -> Text
name) (\s :: XssMatchSetSummary
s@XssMatchSetSummary' {} Text
a -> XssMatchSetSummary
s {$sel:name:XssMatchSetSummary' :: Text
name = Text
a} :: XssMatchSetSummary)

instance Core.FromJSON XssMatchSetSummary where
  parseJSON :: Value -> Parser XssMatchSetSummary
parseJSON =
    String
-> (Object -> Parser XssMatchSetSummary)
-> Value
-> Parser XssMatchSetSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"XssMatchSetSummary"
      ( \Object
x ->
          Text -> Text -> XssMatchSetSummary
XssMatchSetSummary'
            (Text -> Text -> XssMatchSetSummary)
-> Parser Text -> Parser (Text -> XssMatchSetSummary)
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
"XssMatchSetId")
            Parser (Text -> XssMatchSetSummary)
-> Parser Text -> Parser XssMatchSetSummary
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 XssMatchSetSummary

instance Prelude.NFData XssMatchSetSummary