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

-- |
-- Create a value of 'ByteMatchSetSummary' 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:
--
-- 'byteMatchSetId', 'byteMatchSetSummary_byteMatchSetId' - The @ByteMatchSetId@ for a @ByteMatchSet@. You use @ByteMatchSetId@ to
-- get information about a @ByteMatchSet@, update a @ByteMatchSet@, remove
-- a @ByteMatchSet@ from a @Rule@, and delete a @ByteMatchSet@ from AWS
-- WAF.
--
-- @ByteMatchSetId@ is returned by CreateByteMatchSet and by
-- ListByteMatchSets.
--
-- 'name', 'byteMatchSetSummary_name' - A friendly name or description of the ByteMatchSet. You can\'t change
-- @Name@ after you create a @ByteMatchSet@.
newByteMatchSetSummary ::
  -- | 'byteMatchSetId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  ByteMatchSetSummary
newByteMatchSetSummary :: Text -> Text -> ByteMatchSetSummary
newByteMatchSetSummary Text
pByteMatchSetId_ Text
pName_ =
  ByteMatchSetSummary' :: Text -> Text -> ByteMatchSetSummary
ByteMatchSetSummary'
    { $sel:byteMatchSetId:ByteMatchSetSummary' :: Text
byteMatchSetId =
        Text
pByteMatchSetId_,
      $sel:name:ByteMatchSetSummary' :: Text
name = Text
pName_
    }

-- | The @ByteMatchSetId@ for a @ByteMatchSet@. You use @ByteMatchSetId@ to
-- get information about a @ByteMatchSet@, update a @ByteMatchSet@, remove
-- a @ByteMatchSet@ from a @Rule@, and delete a @ByteMatchSet@ from AWS
-- WAF.
--
-- @ByteMatchSetId@ is returned by CreateByteMatchSet and by
-- ListByteMatchSets.
byteMatchSetSummary_byteMatchSetId :: Lens.Lens' ByteMatchSetSummary Prelude.Text
byteMatchSetSummary_byteMatchSetId :: (Text -> f Text) -> ByteMatchSetSummary -> f ByteMatchSetSummary
byteMatchSetSummary_byteMatchSetId = (ByteMatchSetSummary -> Text)
-> (ByteMatchSetSummary -> Text -> ByteMatchSetSummary)
-> Lens ByteMatchSetSummary ByteMatchSetSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ByteMatchSetSummary' {Text
byteMatchSetId :: Text
$sel:byteMatchSetId:ByteMatchSetSummary' :: ByteMatchSetSummary -> Text
byteMatchSetId} -> Text
byteMatchSetId) (\s :: ByteMatchSetSummary
s@ByteMatchSetSummary' {} Text
a -> ByteMatchSetSummary
s {$sel:byteMatchSetId:ByteMatchSetSummary' :: Text
byteMatchSetId = Text
a} :: ByteMatchSetSummary)

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

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

instance Prelude.NFData ByteMatchSetSummary