{-# 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.WebACLSummary
-- 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.WebACLSummary 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.
--
-- Contains the identifier and the name or description of the WebACL.
--
-- /See:/ 'newWebACLSummary' smart constructor.
data WebACLSummary = WebACLSummary'
  { -- | A unique identifier for a @WebACL@. You use @WebACLId@ to get
    -- information about a @WebACL@ (see GetWebACL), update a @WebACL@ (see
    -- UpdateWebACL), and delete a @WebACL@ from AWS WAF (see DeleteWebACL).
    --
    -- @WebACLId@ is returned by CreateWebACL and by ListWebACLs.
    WebACLSummary -> Text
webACLId :: Prelude.Text,
    -- | A friendly name or description of the WebACL. You can\'t change the name
    -- of a @WebACL@ after you create it.
    WebACLSummary -> Text
name :: Prelude.Text
  }
  deriving (WebACLSummary -> WebACLSummary -> Bool
(WebACLSummary -> WebACLSummary -> Bool)
-> (WebACLSummary -> WebACLSummary -> Bool) -> Eq WebACLSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WebACLSummary -> WebACLSummary -> Bool
$c/= :: WebACLSummary -> WebACLSummary -> Bool
== :: WebACLSummary -> WebACLSummary -> Bool
$c== :: WebACLSummary -> WebACLSummary -> Bool
Prelude.Eq, ReadPrec [WebACLSummary]
ReadPrec WebACLSummary
Int -> ReadS WebACLSummary
ReadS [WebACLSummary]
(Int -> ReadS WebACLSummary)
-> ReadS [WebACLSummary]
-> ReadPrec WebACLSummary
-> ReadPrec [WebACLSummary]
-> Read WebACLSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WebACLSummary]
$creadListPrec :: ReadPrec [WebACLSummary]
readPrec :: ReadPrec WebACLSummary
$creadPrec :: ReadPrec WebACLSummary
readList :: ReadS [WebACLSummary]
$creadList :: ReadS [WebACLSummary]
readsPrec :: Int -> ReadS WebACLSummary
$creadsPrec :: Int -> ReadS WebACLSummary
Prelude.Read, Int -> WebACLSummary -> ShowS
[WebACLSummary] -> ShowS
WebACLSummary -> String
(Int -> WebACLSummary -> ShowS)
-> (WebACLSummary -> String)
-> ([WebACLSummary] -> ShowS)
-> Show WebACLSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WebACLSummary] -> ShowS
$cshowList :: [WebACLSummary] -> ShowS
show :: WebACLSummary -> String
$cshow :: WebACLSummary -> String
showsPrec :: Int -> WebACLSummary -> ShowS
$cshowsPrec :: Int -> WebACLSummary -> ShowS
Prelude.Show, (forall x. WebACLSummary -> Rep WebACLSummary x)
-> (forall x. Rep WebACLSummary x -> WebACLSummary)
-> Generic WebACLSummary
forall x. Rep WebACLSummary x -> WebACLSummary
forall x. WebACLSummary -> Rep WebACLSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WebACLSummary x -> WebACLSummary
$cfrom :: forall x. WebACLSummary -> Rep WebACLSummary x
Prelude.Generic)

-- |
-- Create a value of 'WebACLSummary' 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:
--
-- 'webACLId', 'webACLSummary_webACLId' - A unique identifier for a @WebACL@. You use @WebACLId@ to get
-- information about a @WebACL@ (see GetWebACL), update a @WebACL@ (see
-- UpdateWebACL), and delete a @WebACL@ from AWS WAF (see DeleteWebACL).
--
-- @WebACLId@ is returned by CreateWebACL and by ListWebACLs.
--
-- 'name', 'webACLSummary_name' - A friendly name or description of the WebACL. You can\'t change the name
-- of a @WebACL@ after you create it.
newWebACLSummary ::
  -- | 'webACLId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  WebACLSummary
newWebACLSummary :: Text -> Text -> WebACLSummary
newWebACLSummary Text
pWebACLId_ Text
pName_ =
  WebACLSummary' :: Text -> Text -> WebACLSummary
WebACLSummary'
    { $sel:webACLId:WebACLSummary' :: Text
webACLId = Text
pWebACLId_,
      $sel:name:WebACLSummary' :: Text
name = Text
pName_
    }

-- | A unique identifier for a @WebACL@. You use @WebACLId@ to get
-- information about a @WebACL@ (see GetWebACL), update a @WebACL@ (see
-- UpdateWebACL), and delete a @WebACL@ from AWS WAF (see DeleteWebACL).
--
-- @WebACLId@ is returned by CreateWebACL and by ListWebACLs.
webACLSummary_webACLId :: Lens.Lens' WebACLSummary Prelude.Text
webACLSummary_webACLId :: (Text -> f Text) -> WebACLSummary -> f WebACLSummary
webACLSummary_webACLId = (WebACLSummary -> Text)
-> (WebACLSummary -> Text -> WebACLSummary)
-> Lens WebACLSummary WebACLSummary Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WebACLSummary' {Text
webACLId :: Text
$sel:webACLId:WebACLSummary' :: WebACLSummary -> Text
webACLId} -> Text
webACLId) (\s :: WebACLSummary
s@WebACLSummary' {} Text
a -> WebACLSummary
s {$sel:webACLId:WebACLSummary' :: Text
webACLId = Text
a} :: WebACLSummary)

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

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

instance Prelude.NFData WebACLSummary