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

-- |
-- Create a value of 'IPSetSummary' 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:
--
-- 'iPSetId', 'iPSetSummary_iPSetId' - The @IPSetId@ for an IPSet. You can use @IPSetId@ in a GetIPSet request
-- to get detailed information about an IPSet.
--
-- 'name', 'iPSetSummary_name' - A friendly name or description of the IPSet. You can\'t change the name
-- of an @IPSet@ after you create it.
newIPSetSummary ::
  -- | 'iPSetId'
  Prelude.Text ->
  -- | 'name'
  Prelude.Text ->
  IPSetSummary
newIPSetSummary :: Text -> Text -> IPSetSummary
newIPSetSummary Text
pIPSetId_ Text
pName_ =
  IPSetSummary' {$sel:iPSetId:IPSetSummary' :: Text
iPSetId = Text
pIPSetId_, $sel:name:IPSetSummary' :: Text
name = Text
pName_}

-- | The @IPSetId@ for an IPSet. You can use @IPSetId@ in a GetIPSet request
-- to get detailed information about an IPSet.
iPSetSummary_iPSetId :: Lens.Lens' IPSetSummary Prelude.Text
iPSetSummary_iPSetId :: Lens' IPSetSummary Text
iPSetSummary_iPSetId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\IPSetSummary' {Text
iPSetId :: Text
$sel:iPSetId:IPSetSummary' :: IPSetSummary -> Text
iPSetId} -> Text
iPSetId) (\s :: IPSetSummary
s@IPSetSummary' {} Text
a -> IPSetSummary
s {$sel:iPSetId:IPSetSummary' :: Text
iPSetId = Text
a} :: IPSetSummary)

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

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

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