{-# 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.WAFV2.Types.ManagedRuleGroupSummary
-- 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.WAFV2.Types.ManagedRuleGroupSummary 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

-- | High-level information about a managed rule group, returned by
-- ListAvailableManagedRuleGroups. This provides information like the name
-- and vendor name, that you provide when you add a
-- ManagedRuleGroupStatement to a web ACL. Managed rule groups include
-- Amazon Web Services Managed Rules rule groups, which are free of charge
-- to WAF customers, and Amazon Web Services Marketplace managed rule
-- groups, which you can subscribe to through Amazon Web Services
-- Marketplace.
--
-- /See:/ 'newManagedRuleGroupSummary' smart constructor.
data ManagedRuleGroupSummary = ManagedRuleGroupSummary'
  { -- | The description of the managed rule group, provided by Amazon Web
    -- Services Managed Rules or the Amazon Web Services Marketplace seller who
    -- manages it.
    ManagedRuleGroupSummary -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The name of the managed rule group. You use this, along with the vendor
    -- name, to identify the rule group.
    ManagedRuleGroupSummary -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The name of the managed rule group vendor. You use this, along with the
    -- rule group name, to identify the rule group.
    ManagedRuleGroupSummary -> Maybe Text
vendorName :: Prelude.Maybe Prelude.Text,
    -- | Indicates whether the managed rule group is versioned. If it is, you can
    -- retrieve the versions list by calling
    -- ListAvailableManagedRuleGroupVersions.
    ManagedRuleGroupSummary -> Maybe Bool
versioningSupported :: Prelude.Maybe Prelude.Bool
  }
  deriving (ManagedRuleGroupSummary -> ManagedRuleGroupSummary -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ManagedRuleGroupSummary -> ManagedRuleGroupSummary -> Bool
$c/= :: ManagedRuleGroupSummary -> ManagedRuleGroupSummary -> Bool
== :: ManagedRuleGroupSummary -> ManagedRuleGroupSummary -> Bool
$c== :: ManagedRuleGroupSummary -> ManagedRuleGroupSummary -> Bool
Prelude.Eq, ReadPrec [ManagedRuleGroupSummary]
ReadPrec ManagedRuleGroupSummary
Int -> ReadS ManagedRuleGroupSummary
ReadS [ManagedRuleGroupSummary]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ManagedRuleGroupSummary]
$creadListPrec :: ReadPrec [ManagedRuleGroupSummary]
readPrec :: ReadPrec ManagedRuleGroupSummary
$creadPrec :: ReadPrec ManagedRuleGroupSummary
readList :: ReadS [ManagedRuleGroupSummary]
$creadList :: ReadS [ManagedRuleGroupSummary]
readsPrec :: Int -> ReadS ManagedRuleGroupSummary
$creadsPrec :: Int -> ReadS ManagedRuleGroupSummary
Prelude.Read, Int -> ManagedRuleGroupSummary -> ShowS
[ManagedRuleGroupSummary] -> ShowS
ManagedRuleGroupSummary -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ManagedRuleGroupSummary] -> ShowS
$cshowList :: [ManagedRuleGroupSummary] -> ShowS
show :: ManagedRuleGroupSummary -> String
$cshow :: ManagedRuleGroupSummary -> String
showsPrec :: Int -> ManagedRuleGroupSummary -> ShowS
$cshowsPrec :: Int -> ManagedRuleGroupSummary -> ShowS
Prelude.Show, forall x. Rep ManagedRuleGroupSummary x -> ManagedRuleGroupSummary
forall x. ManagedRuleGroupSummary -> Rep ManagedRuleGroupSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ManagedRuleGroupSummary x -> ManagedRuleGroupSummary
$cfrom :: forall x. ManagedRuleGroupSummary -> Rep ManagedRuleGroupSummary x
Prelude.Generic)

-- |
-- Create a value of 'ManagedRuleGroupSummary' 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:
--
-- 'description', 'managedRuleGroupSummary_description' - The description of the managed rule group, provided by Amazon Web
-- Services Managed Rules or the Amazon Web Services Marketplace seller who
-- manages it.
--
-- 'name', 'managedRuleGroupSummary_name' - The name of the managed rule group. You use this, along with the vendor
-- name, to identify the rule group.
--
-- 'vendorName', 'managedRuleGroupSummary_vendorName' - The name of the managed rule group vendor. You use this, along with the
-- rule group name, to identify the rule group.
--
-- 'versioningSupported', 'managedRuleGroupSummary_versioningSupported' - Indicates whether the managed rule group is versioned. If it is, you can
-- retrieve the versions list by calling
-- ListAvailableManagedRuleGroupVersions.
newManagedRuleGroupSummary ::
  ManagedRuleGroupSummary
newManagedRuleGroupSummary :: ManagedRuleGroupSummary
newManagedRuleGroupSummary =
  ManagedRuleGroupSummary'
    { $sel:description:ManagedRuleGroupSummary' :: Maybe Text
description =
        forall a. Maybe a
Prelude.Nothing,
      $sel:name:ManagedRuleGroupSummary' :: Maybe Text
name = forall a. Maybe a
Prelude.Nothing,
      $sel:vendorName:ManagedRuleGroupSummary' :: Maybe Text
vendorName = forall a. Maybe a
Prelude.Nothing,
      $sel:versioningSupported:ManagedRuleGroupSummary' :: Maybe Bool
versioningSupported = forall a. Maybe a
Prelude.Nothing
    }

-- | The description of the managed rule group, provided by Amazon Web
-- Services Managed Rules or the Amazon Web Services Marketplace seller who
-- manages it.
managedRuleGroupSummary_description :: Lens.Lens' ManagedRuleGroupSummary (Prelude.Maybe Prelude.Text)
managedRuleGroupSummary_description :: Lens' ManagedRuleGroupSummary (Maybe Text)
managedRuleGroupSummary_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupSummary' {Maybe Text
description :: Maybe Text
$sel:description:ManagedRuleGroupSummary' :: ManagedRuleGroupSummary -> Maybe Text
description} -> Maybe Text
description) (\s :: ManagedRuleGroupSummary
s@ManagedRuleGroupSummary' {} Maybe Text
a -> ManagedRuleGroupSummary
s {$sel:description:ManagedRuleGroupSummary' :: Maybe Text
description = Maybe Text
a} :: ManagedRuleGroupSummary)

-- | The name of the managed rule group. You use this, along with the vendor
-- name, to identify the rule group.
managedRuleGroupSummary_name :: Lens.Lens' ManagedRuleGroupSummary (Prelude.Maybe Prelude.Text)
managedRuleGroupSummary_name :: Lens' ManagedRuleGroupSummary (Maybe Text)
managedRuleGroupSummary_name = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupSummary' {Maybe Text
name :: Maybe Text
$sel:name:ManagedRuleGroupSummary' :: ManagedRuleGroupSummary -> Maybe Text
name} -> Maybe Text
name) (\s :: ManagedRuleGroupSummary
s@ManagedRuleGroupSummary' {} Maybe Text
a -> ManagedRuleGroupSummary
s {$sel:name:ManagedRuleGroupSummary' :: Maybe Text
name = Maybe Text
a} :: ManagedRuleGroupSummary)

-- | The name of the managed rule group vendor. You use this, along with the
-- rule group name, to identify the rule group.
managedRuleGroupSummary_vendorName :: Lens.Lens' ManagedRuleGroupSummary (Prelude.Maybe Prelude.Text)
managedRuleGroupSummary_vendorName :: Lens' ManagedRuleGroupSummary (Maybe Text)
managedRuleGroupSummary_vendorName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupSummary' {Maybe Text
vendorName :: Maybe Text
$sel:vendorName:ManagedRuleGroupSummary' :: ManagedRuleGroupSummary -> Maybe Text
vendorName} -> Maybe Text
vendorName) (\s :: ManagedRuleGroupSummary
s@ManagedRuleGroupSummary' {} Maybe Text
a -> ManagedRuleGroupSummary
s {$sel:vendorName:ManagedRuleGroupSummary' :: Maybe Text
vendorName = Maybe Text
a} :: ManagedRuleGroupSummary)

-- | Indicates whether the managed rule group is versioned. If it is, you can
-- retrieve the versions list by calling
-- ListAvailableManagedRuleGroupVersions.
managedRuleGroupSummary_versioningSupported :: Lens.Lens' ManagedRuleGroupSummary (Prelude.Maybe Prelude.Bool)
managedRuleGroupSummary_versioningSupported :: Lens' ManagedRuleGroupSummary (Maybe Bool)
managedRuleGroupSummary_versioningSupported = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ManagedRuleGroupSummary' {Maybe Bool
versioningSupported :: Maybe Bool
$sel:versioningSupported:ManagedRuleGroupSummary' :: ManagedRuleGroupSummary -> Maybe Bool
versioningSupported} -> Maybe Bool
versioningSupported) (\s :: ManagedRuleGroupSummary
s@ManagedRuleGroupSummary' {} Maybe Bool
a -> ManagedRuleGroupSummary
s {$sel:versioningSupported:ManagedRuleGroupSummary' :: Maybe Bool
versioningSupported = Maybe Bool
a} :: ManagedRuleGroupSummary)

instance Data.FromJSON ManagedRuleGroupSummary where
  parseJSON :: Value -> Parser ManagedRuleGroupSummary
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"ManagedRuleGroupSummary"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Bool
-> ManagedRuleGroupSummary
ManagedRuleGroupSummary'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Description")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Name")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"VendorName")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"VersioningSupported")
      )

instance Prelude.Hashable ManagedRuleGroupSummary where
  hashWithSalt :: Int -> ManagedRuleGroupSummary -> Int
hashWithSalt Int
_salt ManagedRuleGroupSummary' {Maybe Bool
Maybe Text
versioningSupported :: Maybe Bool
vendorName :: Maybe Text
name :: Maybe Text
description :: Maybe Text
$sel:versioningSupported:ManagedRuleGroupSummary' :: ManagedRuleGroupSummary -> Maybe Bool
$sel:vendorName:ManagedRuleGroupSummary' :: ManagedRuleGroupSummary -> Maybe Text
$sel:name:ManagedRuleGroupSummary' :: ManagedRuleGroupSummary -> Maybe Text
$sel:description:ManagedRuleGroupSummary' :: ManagedRuleGroupSummary -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
name
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vendorName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Bool
versioningSupported

instance Prelude.NFData ManagedRuleGroupSummary where
  rnf :: ManagedRuleGroupSummary -> ()
rnf ManagedRuleGroupSummary' {Maybe Bool
Maybe Text
versioningSupported :: Maybe Bool
vendorName :: Maybe Text
name :: Maybe Text
description :: Maybe Text
$sel:versioningSupported:ManagedRuleGroupSummary' :: ManagedRuleGroupSummary -> Maybe Bool
$sel:vendorName:ManagedRuleGroupSummary' :: ManagedRuleGroupSummary -> Maybe Text
$sel:name:ManagedRuleGroupSummary' :: ManagedRuleGroupSummary -> Maybe Text
$sel:description:ManagedRuleGroupSummary' :: ManagedRuleGroupSummary -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
description
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
name
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vendorName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Bool
versioningSupported