{-# 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.GeoMatchSetSummary
-- 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.WAFRegional.Types.GeoMatchSetSummary 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.
--
-- Contains the identifier and the name of the @GeoMatchSet@.
--
-- /See:/ 'newGeoMatchSetSummary' smart constructor.
data GeoMatchSetSummary = GeoMatchSetSummary'
  { -- | The @GeoMatchSetId@ for an GeoMatchSet. You can use @GeoMatchSetId@ in a
    -- GetGeoMatchSet request to get detailed information about an GeoMatchSet.
    GeoMatchSetSummary -> Text
geoMatchSetId :: Prelude.Text,
    -- | A friendly name or description of the GeoMatchSet. You can\'t change the
    -- name of an @GeoMatchSet@ after you create it.
    GeoMatchSetSummary -> Text
name :: Prelude.Text
  }
  deriving (GeoMatchSetSummary -> GeoMatchSetSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: GeoMatchSetSummary -> GeoMatchSetSummary -> Bool
$c/= :: GeoMatchSetSummary -> GeoMatchSetSummary -> Bool
== :: GeoMatchSetSummary -> GeoMatchSetSummary -> Bool
$c== :: GeoMatchSetSummary -> GeoMatchSetSummary -> Bool
Prelude.Eq, ReadPrec [GeoMatchSetSummary]
ReadPrec GeoMatchSetSummary
Int -> ReadS GeoMatchSetSummary
ReadS [GeoMatchSetSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [GeoMatchSetSummary]
$creadListPrec :: ReadPrec [GeoMatchSetSummary]
readPrec :: ReadPrec GeoMatchSetSummary
$creadPrec :: ReadPrec GeoMatchSetSummary
readList :: ReadS [GeoMatchSetSummary]
$creadList :: ReadS [GeoMatchSetSummary]
readsPrec :: Int -> ReadS GeoMatchSetSummary
$creadsPrec :: Int -> ReadS GeoMatchSetSummary
Prelude.Read, Int -> GeoMatchSetSummary -> ShowS
[GeoMatchSetSummary] -> ShowS
GeoMatchSetSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [GeoMatchSetSummary] -> ShowS
$cshowList :: [GeoMatchSetSummary] -> ShowS
show :: GeoMatchSetSummary -> String
$cshow :: GeoMatchSetSummary -> String
showsPrec :: Int -> GeoMatchSetSummary -> ShowS
$cshowsPrec :: Int -> GeoMatchSetSummary -> ShowS
Prelude.Show, forall x. Rep GeoMatchSetSummary x -> GeoMatchSetSummary
forall x. GeoMatchSetSummary -> Rep GeoMatchSetSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep GeoMatchSetSummary x -> GeoMatchSetSummary
$cfrom :: forall x. GeoMatchSetSummary -> Rep GeoMatchSetSummary x
Prelude.Generic)

-- |
-- Create a value of 'GeoMatchSetSummary' 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:
--
-- 'geoMatchSetId', 'geoMatchSetSummary_geoMatchSetId' - The @GeoMatchSetId@ for an GeoMatchSet. You can use @GeoMatchSetId@ in a
-- GetGeoMatchSet request to get detailed information about an GeoMatchSet.
--
-- 'name', 'geoMatchSetSummary_name' - A friendly name or description of the GeoMatchSet. You can\'t change the
-- name of an @GeoMatchSet@ after you create it.
newGeoMatchSetSummary ::
  -- | 'geoMatchSetId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  GeoMatchSetSummary
newGeoMatchSetSummary :: Text -> Text -> GeoMatchSetSummary
newGeoMatchSetSummary Text
pGeoMatchSetId_ Text
pName_ =
  GeoMatchSetSummary'
    { $sel:geoMatchSetId:GeoMatchSetSummary' :: Text
geoMatchSetId =
        Text
pGeoMatchSetId_,
      $sel:name:GeoMatchSetSummary' :: Text
name = Text
pName_
    }

-- | The @GeoMatchSetId@ for an GeoMatchSet. You can use @GeoMatchSetId@ in a
-- GetGeoMatchSet request to get detailed information about an GeoMatchSet.
geoMatchSetSummary_geoMatchSetId :: Lens.Lens' GeoMatchSetSummary Prelude.Text
geoMatchSetSummary_geoMatchSetId :: Lens' GeoMatchSetSummary Text
geoMatchSetSummary_geoMatchSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\GeoMatchSetSummary' {Text
geoMatchSetId :: Text
$sel:geoMatchSetId:GeoMatchSetSummary' :: GeoMatchSetSummary -> Text
geoMatchSetId} -> Text
geoMatchSetId) (\s :: GeoMatchSetSummary
s@GeoMatchSetSummary' {} Text
a -> GeoMatchSetSummary
s {$sel:geoMatchSetId:GeoMatchSetSummary' :: Text
geoMatchSetId = Text
a} :: GeoMatchSetSummary)

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

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

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