{-# 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.NetworkFirewall.Types.RuleGroupResponse
-- 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.NetworkFirewall.Types.RuleGroupResponse where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.NetworkFirewall.Types.EncryptionConfiguration
import Amazonka.NetworkFirewall.Types.ResourceStatus
import Amazonka.NetworkFirewall.Types.RuleGroupType
import Amazonka.NetworkFirewall.Types.SourceMetadata
import Amazonka.NetworkFirewall.Types.Tag
import qualified Amazonka.Prelude as Prelude

-- | The high-level properties of a rule group. This, along with the
-- RuleGroup, define the rule group. You can retrieve all objects for a
-- rule group by calling DescribeRuleGroup.
--
-- /See:/ 'newRuleGroupResponse' smart constructor.
data RuleGroupResponse = RuleGroupResponse'
  { -- | The maximum operating resources that this rule group can use. Rule group
    -- capacity is fixed at creation. When you update a rule group, you are
    -- limited to this capacity. When you reference a rule group from a
    -- firewall policy, Network Firewall reserves this capacity for the rule
    -- group.
    --
    -- You can retrieve the capacity that would be required for a rule group
    -- before you create the rule group by calling CreateRuleGroup with
    -- @DryRun@ set to @TRUE@.
    RuleGroupResponse -> Maybe Int
capacity :: Prelude.Maybe Prelude.Int,
    -- | The number of capacity units currently consumed by the rule group rules.
    RuleGroupResponse -> Maybe Int
consumedCapacity :: Prelude.Maybe Prelude.Int,
    -- | A description of the rule group.
    RuleGroupResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | A complex type that contains the Amazon Web Services KMS encryption
    -- configuration settings for your rule group.
    RuleGroupResponse -> Maybe EncryptionConfiguration
encryptionConfiguration :: Prelude.Maybe EncryptionConfiguration,
    -- | The last time that the rule group was changed.
    RuleGroupResponse -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Data.POSIX,
    -- | The number of firewall policies that use this rule group.
    RuleGroupResponse -> Maybe Int
numberOfAssociations :: Prelude.Maybe Prelude.Int,
    -- | Detailed information about the current status of a rule group.
    RuleGroupResponse -> Maybe ResourceStatus
ruleGroupStatus :: Prelude.Maybe ResourceStatus,
    -- | The Amazon resource name (ARN) of the Amazon Simple Notification Service
    -- SNS topic that\'s used to record changes to the managed rule group. You
    -- can subscribe to the SNS topic to receive notifications when the managed
    -- rule group is modified, such as for new versions and for version
    -- expiration. For more information, see the
    -- <https://docs.aws.amazon.com/sns/latest/dg/welcome.html Amazon Simple Notification Service Developer Guide.>.
    RuleGroupResponse -> Maybe Text
snsTopic :: Prelude.Maybe Prelude.Text,
    -- | A complex type that contains metadata about the rule group that your own
    -- rule group is copied from. You can use the metadata to track the version
    -- updates made to the originating rule group.
    RuleGroupResponse -> Maybe SourceMetadata
sourceMetadata :: Prelude.Maybe SourceMetadata,
    -- | The key:value pairs to associate with the resource.
    RuleGroupResponse -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | Indicates whether the rule group is stateless or stateful. If the rule
    -- group is stateless, it contains stateless rules. If it is stateful, it
    -- contains stateful rules.
    RuleGroupResponse -> Maybe RuleGroupType
type' :: Prelude.Maybe RuleGroupType,
    -- | The Amazon Resource Name (ARN) of the rule group.
    --
    -- If this response is for a create request that had @DryRun@ set to
    -- @TRUE@, then this ARN is a placeholder that isn\'t attached to a valid
    -- resource.
    RuleGroupResponse -> Text
ruleGroupArn :: Prelude.Text,
    -- | The descriptive name of the rule group. You can\'t change the name of a
    -- rule group after you create it.
    RuleGroupResponse -> Text
ruleGroupName :: Prelude.Text,
    -- | The unique identifier for the rule group.
    RuleGroupResponse -> Text
ruleGroupId :: Prelude.Text
  }
  deriving (RuleGroupResponse -> RuleGroupResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RuleGroupResponse -> RuleGroupResponse -> Bool
$c/= :: RuleGroupResponse -> RuleGroupResponse -> Bool
== :: RuleGroupResponse -> RuleGroupResponse -> Bool
$c== :: RuleGroupResponse -> RuleGroupResponse -> Bool
Prelude.Eq, ReadPrec [RuleGroupResponse]
ReadPrec RuleGroupResponse
Int -> ReadS RuleGroupResponse
ReadS [RuleGroupResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RuleGroupResponse]
$creadListPrec :: ReadPrec [RuleGroupResponse]
readPrec :: ReadPrec RuleGroupResponse
$creadPrec :: ReadPrec RuleGroupResponse
readList :: ReadS [RuleGroupResponse]
$creadList :: ReadS [RuleGroupResponse]
readsPrec :: Int -> ReadS RuleGroupResponse
$creadsPrec :: Int -> ReadS RuleGroupResponse
Prelude.Read, Int -> RuleGroupResponse -> ShowS
[RuleGroupResponse] -> ShowS
RuleGroupResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RuleGroupResponse] -> ShowS
$cshowList :: [RuleGroupResponse] -> ShowS
show :: RuleGroupResponse -> String
$cshow :: RuleGroupResponse -> String
showsPrec :: Int -> RuleGroupResponse -> ShowS
$cshowsPrec :: Int -> RuleGroupResponse -> ShowS
Prelude.Show, forall x. Rep RuleGroupResponse x -> RuleGroupResponse
forall x. RuleGroupResponse -> Rep RuleGroupResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RuleGroupResponse x -> RuleGroupResponse
$cfrom :: forall x. RuleGroupResponse -> Rep RuleGroupResponse x
Prelude.Generic)

-- |
-- Create a value of 'RuleGroupResponse' 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:
--
-- 'capacity', 'ruleGroupResponse_capacity' - The maximum operating resources that this rule group can use. Rule group
-- capacity is fixed at creation. When you update a rule group, you are
-- limited to this capacity. When you reference a rule group from a
-- firewall policy, Network Firewall reserves this capacity for the rule
-- group.
--
-- You can retrieve the capacity that would be required for a rule group
-- before you create the rule group by calling CreateRuleGroup with
-- @DryRun@ set to @TRUE@.
--
-- 'consumedCapacity', 'ruleGroupResponse_consumedCapacity' - The number of capacity units currently consumed by the rule group rules.
--
-- 'description', 'ruleGroupResponse_description' - A description of the rule group.
--
-- 'encryptionConfiguration', 'ruleGroupResponse_encryptionConfiguration' - A complex type that contains the Amazon Web Services KMS encryption
-- configuration settings for your rule group.
--
-- 'lastModifiedTime', 'ruleGroupResponse_lastModifiedTime' - The last time that the rule group was changed.
--
-- 'numberOfAssociations', 'ruleGroupResponse_numberOfAssociations' - The number of firewall policies that use this rule group.
--
-- 'ruleGroupStatus', 'ruleGroupResponse_ruleGroupStatus' - Detailed information about the current status of a rule group.
--
-- 'snsTopic', 'ruleGroupResponse_snsTopic' - The Amazon resource name (ARN) of the Amazon Simple Notification Service
-- SNS topic that\'s used to record changes to the managed rule group. You
-- can subscribe to the SNS topic to receive notifications when the managed
-- rule group is modified, such as for new versions and for version
-- expiration. For more information, see the
-- <https://docs.aws.amazon.com/sns/latest/dg/welcome.html Amazon Simple Notification Service Developer Guide.>.
--
-- 'sourceMetadata', 'ruleGroupResponse_sourceMetadata' - A complex type that contains metadata about the rule group that your own
-- rule group is copied from. You can use the metadata to track the version
-- updates made to the originating rule group.
--
-- 'tags', 'ruleGroupResponse_tags' - The key:value pairs to associate with the resource.
--
-- 'type'', 'ruleGroupResponse_type' - Indicates whether the rule group is stateless or stateful. If the rule
-- group is stateless, it contains stateless rules. If it is stateful, it
-- contains stateful rules.
--
-- 'ruleGroupArn', 'ruleGroupResponse_ruleGroupArn' - The Amazon Resource Name (ARN) of the rule group.
--
-- If this response is for a create request that had @DryRun@ set to
-- @TRUE@, then this ARN is a placeholder that isn\'t attached to a valid
-- resource.
--
-- 'ruleGroupName', 'ruleGroupResponse_ruleGroupName' - The descriptive name of the rule group. You can\'t change the name of a
-- rule group after you create it.
--
-- 'ruleGroupId', 'ruleGroupResponse_ruleGroupId' - The unique identifier for the rule group.
newRuleGroupResponse ::
  -- | 'ruleGroupArn'
  Prelude.Text ->
  -- | 'ruleGroupName'
  Prelude.Text ->
  -- | 'ruleGroupId'
  Prelude.Text ->
  RuleGroupResponse
newRuleGroupResponse :: Text -> Text -> Text -> RuleGroupResponse
newRuleGroupResponse
  Text
pRuleGroupArn_
  Text
pRuleGroupName_
  Text
pRuleGroupId_ =
    RuleGroupResponse'
      { $sel:capacity:RuleGroupResponse' :: Maybe Int
capacity = forall a. Maybe a
Prelude.Nothing,
        $sel:consumedCapacity:RuleGroupResponse' :: Maybe Int
consumedCapacity = forall a. Maybe a
Prelude.Nothing,
        $sel:description:RuleGroupResponse' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:encryptionConfiguration:RuleGroupResponse' :: Maybe EncryptionConfiguration
encryptionConfiguration = forall a. Maybe a
Prelude.Nothing,
        $sel:lastModifiedTime:RuleGroupResponse' :: Maybe POSIX
lastModifiedTime = forall a. Maybe a
Prelude.Nothing,
        $sel:numberOfAssociations:RuleGroupResponse' :: Maybe Int
numberOfAssociations = forall a. Maybe a
Prelude.Nothing,
        $sel:ruleGroupStatus:RuleGroupResponse' :: Maybe ResourceStatus
ruleGroupStatus = forall a. Maybe a
Prelude.Nothing,
        $sel:snsTopic:RuleGroupResponse' :: Maybe Text
snsTopic = forall a. Maybe a
Prelude.Nothing,
        $sel:sourceMetadata:RuleGroupResponse' :: Maybe SourceMetadata
sourceMetadata = forall a. Maybe a
Prelude.Nothing,
        $sel:tags:RuleGroupResponse' :: Maybe (NonEmpty Tag)
tags = forall a. Maybe a
Prelude.Nothing,
        $sel:type':RuleGroupResponse' :: Maybe RuleGroupType
type' = forall a. Maybe a
Prelude.Nothing,
        $sel:ruleGroupArn:RuleGroupResponse' :: Text
ruleGroupArn = Text
pRuleGroupArn_,
        $sel:ruleGroupName:RuleGroupResponse' :: Text
ruleGroupName = Text
pRuleGroupName_,
        $sel:ruleGroupId:RuleGroupResponse' :: Text
ruleGroupId = Text
pRuleGroupId_
      }

-- | The maximum operating resources that this rule group can use. Rule group
-- capacity is fixed at creation. When you update a rule group, you are
-- limited to this capacity. When you reference a rule group from a
-- firewall policy, Network Firewall reserves this capacity for the rule
-- group.
--
-- You can retrieve the capacity that would be required for a rule group
-- before you create the rule group by calling CreateRuleGroup with
-- @DryRun@ set to @TRUE@.
ruleGroupResponse_capacity :: Lens.Lens' RuleGroupResponse (Prelude.Maybe Prelude.Int)
ruleGroupResponse_capacity :: Lens' RuleGroupResponse (Maybe Int)
ruleGroupResponse_capacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Maybe Int
capacity :: Maybe Int
$sel:capacity:RuleGroupResponse' :: RuleGroupResponse -> Maybe Int
capacity} -> Maybe Int
capacity) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Maybe Int
a -> RuleGroupResponse
s {$sel:capacity:RuleGroupResponse' :: Maybe Int
capacity = Maybe Int
a} :: RuleGroupResponse)

-- | The number of capacity units currently consumed by the rule group rules.
ruleGroupResponse_consumedCapacity :: Lens.Lens' RuleGroupResponse (Prelude.Maybe Prelude.Int)
ruleGroupResponse_consumedCapacity :: Lens' RuleGroupResponse (Maybe Int)
ruleGroupResponse_consumedCapacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Maybe Int
consumedCapacity :: Maybe Int
$sel:consumedCapacity:RuleGroupResponse' :: RuleGroupResponse -> Maybe Int
consumedCapacity} -> Maybe Int
consumedCapacity) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Maybe Int
a -> RuleGroupResponse
s {$sel:consumedCapacity:RuleGroupResponse' :: Maybe Int
consumedCapacity = Maybe Int
a} :: RuleGroupResponse)

-- | A description of the rule group.
ruleGroupResponse_description :: Lens.Lens' RuleGroupResponse (Prelude.Maybe Prelude.Text)
ruleGroupResponse_description :: Lens' RuleGroupResponse (Maybe Text)
ruleGroupResponse_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Maybe Text
description :: Maybe Text
$sel:description:RuleGroupResponse' :: RuleGroupResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Maybe Text
a -> RuleGroupResponse
s {$sel:description:RuleGroupResponse' :: Maybe Text
description = Maybe Text
a} :: RuleGroupResponse)

-- | A complex type that contains the Amazon Web Services KMS encryption
-- configuration settings for your rule group.
ruleGroupResponse_encryptionConfiguration :: Lens.Lens' RuleGroupResponse (Prelude.Maybe EncryptionConfiguration)
ruleGroupResponse_encryptionConfiguration :: Lens' RuleGroupResponse (Maybe EncryptionConfiguration)
ruleGroupResponse_encryptionConfiguration = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Maybe EncryptionConfiguration
encryptionConfiguration :: Maybe EncryptionConfiguration
$sel:encryptionConfiguration:RuleGroupResponse' :: RuleGroupResponse -> Maybe EncryptionConfiguration
encryptionConfiguration} -> Maybe EncryptionConfiguration
encryptionConfiguration) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Maybe EncryptionConfiguration
a -> RuleGroupResponse
s {$sel:encryptionConfiguration:RuleGroupResponse' :: Maybe EncryptionConfiguration
encryptionConfiguration = Maybe EncryptionConfiguration
a} :: RuleGroupResponse)

-- | The last time that the rule group was changed.
ruleGroupResponse_lastModifiedTime :: Lens.Lens' RuleGroupResponse (Prelude.Maybe Prelude.UTCTime)
ruleGroupResponse_lastModifiedTime :: Lens' RuleGroupResponse (Maybe UTCTime)
ruleGroupResponse_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:RuleGroupResponse' :: RuleGroupResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Maybe POSIX
a -> RuleGroupResponse
s {$sel:lastModifiedTime:RuleGroupResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: RuleGroupResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall (a :: Format). Iso' (Time a) UTCTime
Data._Time

-- | The number of firewall policies that use this rule group.
ruleGroupResponse_numberOfAssociations :: Lens.Lens' RuleGroupResponse (Prelude.Maybe Prelude.Int)
ruleGroupResponse_numberOfAssociations :: Lens' RuleGroupResponse (Maybe Int)
ruleGroupResponse_numberOfAssociations = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Maybe Int
numberOfAssociations :: Maybe Int
$sel:numberOfAssociations:RuleGroupResponse' :: RuleGroupResponse -> Maybe Int
numberOfAssociations} -> Maybe Int
numberOfAssociations) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Maybe Int
a -> RuleGroupResponse
s {$sel:numberOfAssociations:RuleGroupResponse' :: Maybe Int
numberOfAssociations = Maybe Int
a} :: RuleGroupResponse)

-- | Detailed information about the current status of a rule group.
ruleGroupResponse_ruleGroupStatus :: Lens.Lens' RuleGroupResponse (Prelude.Maybe ResourceStatus)
ruleGroupResponse_ruleGroupStatus :: Lens' RuleGroupResponse (Maybe ResourceStatus)
ruleGroupResponse_ruleGroupStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Maybe ResourceStatus
ruleGroupStatus :: Maybe ResourceStatus
$sel:ruleGroupStatus:RuleGroupResponse' :: RuleGroupResponse -> Maybe ResourceStatus
ruleGroupStatus} -> Maybe ResourceStatus
ruleGroupStatus) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Maybe ResourceStatus
a -> RuleGroupResponse
s {$sel:ruleGroupStatus:RuleGroupResponse' :: Maybe ResourceStatus
ruleGroupStatus = Maybe ResourceStatus
a} :: RuleGroupResponse)

-- | The Amazon resource name (ARN) of the Amazon Simple Notification Service
-- SNS topic that\'s used to record changes to the managed rule group. You
-- can subscribe to the SNS topic to receive notifications when the managed
-- rule group is modified, such as for new versions and for version
-- expiration. For more information, see the
-- <https://docs.aws.amazon.com/sns/latest/dg/welcome.html Amazon Simple Notification Service Developer Guide.>.
ruleGroupResponse_snsTopic :: Lens.Lens' RuleGroupResponse (Prelude.Maybe Prelude.Text)
ruleGroupResponse_snsTopic :: Lens' RuleGroupResponse (Maybe Text)
ruleGroupResponse_snsTopic = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Maybe Text
snsTopic :: Maybe Text
$sel:snsTopic:RuleGroupResponse' :: RuleGroupResponse -> Maybe Text
snsTopic} -> Maybe Text
snsTopic) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Maybe Text
a -> RuleGroupResponse
s {$sel:snsTopic:RuleGroupResponse' :: Maybe Text
snsTopic = Maybe Text
a} :: RuleGroupResponse)

-- | A complex type that contains metadata about the rule group that your own
-- rule group is copied from. You can use the metadata to track the version
-- updates made to the originating rule group.
ruleGroupResponse_sourceMetadata :: Lens.Lens' RuleGroupResponse (Prelude.Maybe SourceMetadata)
ruleGroupResponse_sourceMetadata :: Lens' RuleGroupResponse (Maybe SourceMetadata)
ruleGroupResponse_sourceMetadata = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Maybe SourceMetadata
sourceMetadata :: Maybe SourceMetadata
$sel:sourceMetadata:RuleGroupResponse' :: RuleGroupResponse -> Maybe SourceMetadata
sourceMetadata} -> Maybe SourceMetadata
sourceMetadata) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Maybe SourceMetadata
a -> RuleGroupResponse
s {$sel:sourceMetadata:RuleGroupResponse' :: Maybe SourceMetadata
sourceMetadata = Maybe SourceMetadata
a} :: RuleGroupResponse)

-- | The key:value pairs to associate with the resource.
ruleGroupResponse_tags :: Lens.Lens' RuleGroupResponse (Prelude.Maybe (Prelude.NonEmpty Tag))
ruleGroupResponse_tags :: Lens' RuleGroupResponse (Maybe (NonEmpty Tag))
ruleGroupResponse_tags = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Maybe (NonEmpty Tag)
tags :: Maybe (NonEmpty Tag)
$sel:tags:RuleGroupResponse' :: RuleGroupResponse -> Maybe (NonEmpty Tag)
tags} -> Maybe (NonEmpty Tag)
tags) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Maybe (NonEmpty Tag)
a -> RuleGroupResponse
s {$sel:tags:RuleGroupResponse' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
a} :: RuleGroupResponse) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | Indicates whether the rule group is stateless or stateful. If the rule
-- group is stateless, it contains stateless rules. If it is stateful, it
-- contains stateful rules.
ruleGroupResponse_type :: Lens.Lens' RuleGroupResponse (Prelude.Maybe RuleGroupType)
ruleGroupResponse_type :: Lens' RuleGroupResponse (Maybe RuleGroupType)
ruleGroupResponse_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Maybe RuleGroupType
type' :: Maybe RuleGroupType
$sel:type':RuleGroupResponse' :: RuleGroupResponse -> Maybe RuleGroupType
type'} -> Maybe RuleGroupType
type') (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Maybe RuleGroupType
a -> RuleGroupResponse
s {$sel:type':RuleGroupResponse' :: Maybe RuleGroupType
type' = Maybe RuleGroupType
a} :: RuleGroupResponse)

-- | The Amazon Resource Name (ARN) of the rule group.
--
-- If this response is for a create request that had @DryRun@ set to
-- @TRUE@, then this ARN is a placeholder that isn\'t attached to a valid
-- resource.
ruleGroupResponse_ruleGroupArn :: Lens.Lens' RuleGroupResponse Prelude.Text
ruleGroupResponse_ruleGroupArn :: Lens' RuleGroupResponse Text
ruleGroupResponse_ruleGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Text
ruleGroupArn :: Text
$sel:ruleGroupArn:RuleGroupResponse' :: RuleGroupResponse -> Text
ruleGroupArn} -> Text
ruleGroupArn) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Text
a -> RuleGroupResponse
s {$sel:ruleGroupArn:RuleGroupResponse' :: Text
ruleGroupArn = Text
a} :: RuleGroupResponse)

-- | The descriptive name of the rule group. You can\'t change the name of a
-- rule group after you create it.
ruleGroupResponse_ruleGroupName :: Lens.Lens' RuleGroupResponse Prelude.Text
ruleGroupResponse_ruleGroupName :: Lens' RuleGroupResponse Text
ruleGroupResponse_ruleGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Text
ruleGroupName :: Text
$sel:ruleGroupName:RuleGroupResponse' :: RuleGroupResponse -> Text
ruleGroupName} -> Text
ruleGroupName) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Text
a -> RuleGroupResponse
s {$sel:ruleGroupName:RuleGroupResponse' :: Text
ruleGroupName = Text
a} :: RuleGroupResponse)

-- | The unique identifier for the rule group.
ruleGroupResponse_ruleGroupId :: Lens.Lens' RuleGroupResponse Prelude.Text
ruleGroupResponse_ruleGroupId :: Lens' RuleGroupResponse Text
ruleGroupResponse_ruleGroupId = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RuleGroupResponse' {Text
ruleGroupId :: Text
$sel:ruleGroupId:RuleGroupResponse' :: RuleGroupResponse -> Text
ruleGroupId} -> Text
ruleGroupId) (\s :: RuleGroupResponse
s@RuleGroupResponse' {} Text
a -> RuleGroupResponse
s {$sel:ruleGroupId:RuleGroupResponse' :: Text
ruleGroupId = Text
a} :: RuleGroupResponse)

instance Data.FromJSON RuleGroupResponse where
  parseJSON :: Value -> Parser RuleGroupResponse
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"RuleGroupResponse"
      ( \Object
x ->
          Maybe Int
-> Maybe Int
-> Maybe Text
-> Maybe EncryptionConfiguration
-> Maybe POSIX
-> Maybe Int
-> Maybe ResourceStatus
-> Maybe Text
-> Maybe SourceMetadata
-> Maybe (NonEmpty Tag)
-> Maybe RuleGroupType
-> Text
-> Text
-> Text
-> RuleGroupResponse
RuleGroupResponse'
            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
"Capacity")
            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
"ConsumedCapacity")
            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
"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
"EncryptionConfiguration")
            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
"LastModifiedTime")
            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
"NumberOfAssociations")
            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
"RuleGroupStatus")
            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
"SnsTopic")
            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
"SourceMetadata")
            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
"Tags")
            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
"Type")
            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
"RuleGroupArn")
            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
"RuleGroupName")
            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
"RuleGroupId")
      )

instance Prelude.Hashable RuleGroupResponse where
  hashWithSalt :: Int -> RuleGroupResponse -> Int
hashWithSalt Int
_salt RuleGroupResponse' {Maybe Int
Maybe (NonEmpty Tag)
Maybe Text
Maybe POSIX
Maybe EncryptionConfiguration
Maybe ResourceStatus
Maybe RuleGroupType
Maybe SourceMetadata
Text
ruleGroupId :: Text
ruleGroupName :: Text
ruleGroupArn :: Text
type' :: Maybe RuleGroupType
tags :: Maybe (NonEmpty Tag)
sourceMetadata :: Maybe SourceMetadata
snsTopic :: Maybe Text
ruleGroupStatus :: Maybe ResourceStatus
numberOfAssociations :: Maybe Int
lastModifiedTime :: Maybe POSIX
encryptionConfiguration :: Maybe EncryptionConfiguration
description :: Maybe Text
consumedCapacity :: Maybe Int
capacity :: Maybe Int
$sel:ruleGroupId:RuleGroupResponse' :: RuleGroupResponse -> Text
$sel:ruleGroupName:RuleGroupResponse' :: RuleGroupResponse -> Text
$sel:ruleGroupArn:RuleGroupResponse' :: RuleGroupResponse -> Text
$sel:type':RuleGroupResponse' :: RuleGroupResponse -> Maybe RuleGroupType
$sel:tags:RuleGroupResponse' :: RuleGroupResponse -> Maybe (NonEmpty Tag)
$sel:sourceMetadata:RuleGroupResponse' :: RuleGroupResponse -> Maybe SourceMetadata
$sel:snsTopic:RuleGroupResponse' :: RuleGroupResponse -> Maybe Text
$sel:ruleGroupStatus:RuleGroupResponse' :: RuleGroupResponse -> Maybe ResourceStatus
$sel:numberOfAssociations:RuleGroupResponse' :: RuleGroupResponse -> Maybe Int
$sel:lastModifiedTime:RuleGroupResponse' :: RuleGroupResponse -> Maybe POSIX
$sel:encryptionConfiguration:RuleGroupResponse' :: RuleGroupResponse -> Maybe EncryptionConfiguration
$sel:description:RuleGroupResponse' :: RuleGroupResponse -> Maybe Text
$sel:consumedCapacity:RuleGroupResponse' :: RuleGroupResponse -> Maybe Int
$sel:capacity:RuleGroupResponse' :: RuleGroupResponse -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
capacity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
consumedCapacity
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
description
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe EncryptionConfiguration
encryptionConfiguration
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe POSIX
lastModifiedTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
numberOfAssociations
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe ResourceStatus
ruleGroupStatus
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
snsTopic
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe SourceMetadata
sourceMetadata
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe (NonEmpty Tag)
tags
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RuleGroupType
type'
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
ruleGroupId

instance Prelude.NFData RuleGroupResponse where
  rnf :: RuleGroupResponse -> ()
rnf RuleGroupResponse' {Maybe Int
Maybe (NonEmpty Tag)
Maybe Text
Maybe POSIX
Maybe EncryptionConfiguration
Maybe ResourceStatus
Maybe RuleGroupType
Maybe SourceMetadata
Text
ruleGroupId :: Text
ruleGroupName :: Text
ruleGroupArn :: Text
type' :: Maybe RuleGroupType
tags :: Maybe (NonEmpty Tag)
sourceMetadata :: Maybe SourceMetadata
snsTopic :: Maybe Text
ruleGroupStatus :: Maybe ResourceStatus
numberOfAssociations :: Maybe Int
lastModifiedTime :: Maybe POSIX
encryptionConfiguration :: Maybe EncryptionConfiguration
description :: Maybe Text
consumedCapacity :: Maybe Int
capacity :: Maybe Int
$sel:ruleGroupId:RuleGroupResponse' :: RuleGroupResponse -> Text
$sel:ruleGroupName:RuleGroupResponse' :: RuleGroupResponse -> Text
$sel:ruleGroupArn:RuleGroupResponse' :: RuleGroupResponse -> Text
$sel:type':RuleGroupResponse' :: RuleGroupResponse -> Maybe RuleGroupType
$sel:tags:RuleGroupResponse' :: RuleGroupResponse -> Maybe (NonEmpty Tag)
$sel:sourceMetadata:RuleGroupResponse' :: RuleGroupResponse -> Maybe SourceMetadata
$sel:snsTopic:RuleGroupResponse' :: RuleGroupResponse -> Maybe Text
$sel:ruleGroupStatus:RuleGroupResponse' :: RuleGroupResponse -> Maybe ResourceStatus
$sel:numberOfAssociations:RuleGroupResponse' :: RuleGroupResponse -> Maybe Int
$sel:lastModifiedTime:RuleGroupResponse' :: RuleGroupResponse -> Maybe POSIX
$sel:encryptionConfiguration:RuleGroupResponse' :: RuleGroupResponse -> Maybe EncryptionConfiguration
$sel:description:RuleGroupResponse' :: RuleGroupResponse -> Maybe Text
$sel:consumedCapacity:RuleGroupResponse' :: RuleGroupResponse -> Maybe Int
$sel:capacity:RuleGroupResponse' :: RuleGroupResponse -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
capacity
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
consumedCapacity
      seq :: forall a b. a -> b -> b
`Prelude.seq` 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 EncryptionConfiguration
encryptionConfiguration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe POSIX
lastModifiedTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
numberOfAssociations
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe ResourceStatus
ruleGroupStatus
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
snsTopic
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe SourceMetadata
sourceMetadata
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe (NonEmpty Tag)
tags
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RuleGroupType
type'
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ruleGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ruleGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
ruleGroupId