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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.NetworkFirewall.Types.ResourceStatus
import Amazonka.NetworkFirewall.Types.RuleGroupType
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 number of firewall policies that use this rule group.
    RuleGroupResponse -> Maybe Int
numberOfAssociations :: Prelude.Maybe Prelude.Int,
    -- | 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,
    -- | Detailed information about the current status of a rule group.
    RuleGroupResponse -> Maybe ResourceStatus
ruleGroupStatus :: Prelude.Maybe ResourceStatus,
    -- | 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,
    -- | A description of the rule group.
    RuleGroupResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The key:value pairs to associate with the resource.
    RuleGroupResponse -> Maybe (NonEmpty Tag)
tags :: Prelude.Maybe (Prelude.NonEmpty Tag),
    -- | 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
(RuleGroupResponse -> RuleGroupResponse -> Bool)
-> (RuleGroupResponse -> RuleGroupResponse -> Bool)
-> Eq RuleGroupResponse
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]
(Int -> ReadS RuleGroupResponse)
-> ReadS [RuleGroupResponse]
-> ReadPrec RuleGroupResponse
-> ReadPrec [RuleGroupResponse]
-> Read 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
(Int -> RuleGroupResponse -> ShowS)
-> (RuleGroupResponse -> String)
-> ([RuleGroupResponse] -> ShowS)
-> Show RuleGroupResponse
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. RuleGroupResponse -> Rep RuleGroupResponse x)
-> (forall x. Rep RuleGroupResponse x -> RuleGroupResponse)
-> Generic RuleGroupResponse
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:
--
-- 'numberOfAssociations', 'ruleGroupResponse_numberOfAssociations' - The number of firewall policies that use this rule group.
--
-- '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.
--
-- 'ruleGroupStatus', 'ruleGroupResponse_ruleGroupStatus' - Detailed information about the current status of a rule group.
--
-- '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.
--
-- 'description', 'ruleGroupResponse_description' - A description of the rule group.
--
-- 'tags', 'ruleGroupResponse_tags' - The key:value pairs to associate with the resource.
--
-- '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' :: Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe ResourceStatus
-> Maybe RuleGroupType
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> Text
-> Text
-> RuleGroupResponse
RuleGroupResponse'
      { $sel:numberOfAssociations:RuleGroupResponse' :: Maybe Int
numberOfAssociations =
          Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:capacity:RuleGroupResponse' :: Maybe Int
capacity = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:consumedCapacity:RuleGroupResponse' :: Maybe Int
consumedCapacity = Maybe Int
forall a. Maybe a
Prelude.Nothing,
        $sel:ruleGroupStatus:RuleGroupResponse' :: Maybe ResourceStatus
ruleGroupStatus = Maybe ResourceStatus
forall a. Maybe a
Prelude.Nothing,
        $sel:type':RuleGroupResponse' :: Maybe RuleGroupType
type' = Maybe RuleGroupType
forall a. Maybe a
Prelude.Nothing,
        $sel:description:RuleGroupResponse' :: Maybe Text
description = Maybe Text
forall a. Maybe a
Prelude.Nothing,
        $sel:tags:RuleGroupResponse' :: Maybe (NonEmpty Tag)
tags = Maybe (NonEmpty Tag)
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 number of firewall policies that use this rule group.
ruleGroupResponse_numberOfAssociations :: Lens.Lens' RuleGroupResponse (Prelude.Maybe Prelude.Int)
ruleGroupResponse_numberOfAssociations :: (Maybe Int -> f (Maybe Int))
-> RuleGroupResponse -> f RuleGroupResponse
ruleGroupResponse_numberOfAssociations = (RuleGroupResponse -> Maybe Int)
-> (RuleGroupResponse -> Maybe Int -> RuleGroupResponse)
-> Lens RuleGroupResponse RuleGroupResponse (Maybe Int) (Maybe Int)
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)

-- | 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 :: (Maybe Int -> f (Maybe Int))
-> RuleGroupResponse -> f RuleGroupResponse
ruleGroupResponse_capacity = (RuleGroupResponse -> Maybe Int)
-> (RuleGroupResponse -> Maybe Int -> RuleGroupResponse)
-> Lens RuleGroupResponse RuleGroupResponse (Maybe Int) (Maybe Int)
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 :: (Maybe Int -> f (Maybe Int))
-> RuleGroupResponse -> f RuleGroupResponse
ruleGroupResponse_consumedCapacity = (RuleGroupResponse -> Maybe Int)
-> (RuleGroupResponse -> Maybe Int -> RuleGroupResponse)
-> Lens RuleGroupResponse RuleGroupResponse (Maybe Int) (Maybe Int)
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)

-- | Detailed information about the current status of a rule group.
ruleGroupResponse_ruleGroupStatus :: Lens.Lens' RuleGroupResponse (Prelude.Maybe ResourceStatus)
ruleGroupResponse_ruleGroupStatus :: (Maybe ResourceStatus -> f (Maybe ResourceStatus))
-> RuleGroupResponse -> f RuleGroupResponse
ruleGroupResponse_ruleGroupStatus = (RuleGroupResponse -> Maybe ResourceStatus)
-> (RuleGroupResponse -> Maybe ResourceStatus -> RuleGroupResponse)
-> Lens
     RuleGroupResponse
     RuleGroupResponse
     (Maybe ResourceStatus)
     (Maybe ResourceStatus)
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)

-- | 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 :: (Maybe RuleGroupType -> f (Maybe RuleGroupType))
-> RuleGroupResponse -> f RuleGroupResponse
ruleGroupResponse_type = (RuleGroupResponse -> Maybe RuleGroupType)
-> (RuleGroupResponse -> Maybe RuleGroupType -> RuleGroupResponse)
-> Lens
     RuleGroupResponse
     RuleGroupResponse
     (Maybe RuleGroupType)
     (Maybe RuleGroupType)
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)

-- | A description of the rule group.
ruleGroupResponse_description :: Lens.Lens' RuleGroupResponse (Prelude.Maybe Prelude.Text)
ruleGroupResponse_description :: (Maybe Text -> f (Maybe Text))
-> RuleGroupResponse -> f RuleGroupResponse
ruleGroupResponse_description = (RuleGroupResponse -> Maybe Text)
-> (RuleGroupResponse -> Maybe Text -> RuleGroupResponse)
-> Lens
     RuleGroupResponse RuleGroupResponse (Maybe Text) (Maybe Text)
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)

-- | The key:value pairs to associate with the resource.
ruleGroupResponse_tags :: Lens.Lens' RuleGroupResponse (Prelude.Maybe (Prelude.NonEmpty Tag))
ruleGroupResponse_tags :: (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> RuleGroupResponse -> f RuleGroupResponse
ruleGroupResponse_tags = (RuleGroupResponse -> Maybe (NonEmpty Tag))
-> (RuleGroupResponse -> Maybe (NonEmpty Tag) -> RuleGroupResponse)
-> Lens
     RuleGroupResponse
     RuleGroupResponse
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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) ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
 -> RuleGroupResponse -> f RuleGroupResponse)
-> ((Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
    -> Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> (Maybe (NonEmpty Tag) -> f (Maybe (NonEmpty Tag)))
-> RuleGroupResponse
-> f RuleGroupResponse
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
-> Iso
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
     (Maybe (NonEmpty Tag))
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 AnIso (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag) (NonEmpty Tag)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | 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 :: (Text -> f Text) -> RuleGroupResponse -> f RuleGroupResponse
ruleGroupResponse_ruleGroupArn = (RuleGroupResponse -> Text)
-> (RuleGroupResponse -> Text -> RuleGroupResponse)
-> Lens RuleGroupResponse RuleGroupResponse Text Text
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 :: (Text -> f Text) -> RuleGroupResponse -> f RuleGroupResponse
ruleGroupResponse_ruleGroupName = (RuleGroupResponse -> Text)
-> (RuleGroupResponse -> Text -> RuleGroupResponse)
-> Lens RuleGroupResponse RuleGroupResponse Text Text
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 :: (Text -> f Text) -> RuleGroupResponse -> f RuleGroupResponse
ruleGroupResponse_ruleGroupId = (RuleGroupResponse -> Text)
-> (RuleGroupResponse -> Text -> RuleGroupResponse)
-> Lens RuleGroupResponse RuleGroupResponse Text Text
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 Core.FromJSON RuleGroupResponse where
  parseJSON :: Value -> Parser RuleGroupResponse
parseJSON =
    String
-> (Object -> Parser RuleGroupResponse)
-> Value
-> Parser RuleGroupResponse
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"RuleGroupResponse"
      ( \Object
x ->
          Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe ResourceStatus
-> Maybe RuleGroupType
-> Maybe Text
-> Maybe (NonEmpty Tag)
-> Text
-> Text
-> Text
-> RuleGroupResponse
RuleGroupResponse'
            (Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe ResourceStatus
 -> Maybe RuleGroupType
 -> Maybe Text
 -> Maybe (NonEmpty Tag)
 -> Text
 -> Text
 -> Text
 -> RuleGroupResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe ResourceStatus
      -> Maybe RuleGroupType
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Text
      -> Text
      -> Text
      -> RuleGroupResponse)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"NumberOfAssociations")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe ResourceStatus
   -> Maybe RuleGroupType
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Text
   -> Text
   -> Text
   -> RuleGroupResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe ResourceStatus
      -> Maybe RuleGroupType
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Text
      -> Text
      -> Text
      -> RuleGroupResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Capacity")
            Parser
  (Maybe Int
   -> Maybe ResourceStatus
   -> Maybe RuleGroupType
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Text
   -> Text
   -> Text
   -> RuleGroupResponse)
-> Parser (Maybe Int)
-> Parser
     (Maybe ResourceStatus
      -> Maybe RuleGroupType
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Text
      -> Text
      -> Text
      -> RuleGroupResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ConsumedCapacity")
            Parser
  (Maybe ResourceStatus
   -> Maybe RuleGroupType
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Text
   -> Text
   -> Text
   -> RuleGroupResponse)
-> Parser (Maybe ResourceStatus)
-> Parser
     (Maybe RuleGroupType
      -> Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Text
      -> Text
      -> Text
      -> RuleGroupResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ResourceStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"RuleGroupStatus")
            Parser
  (Maybe RuleGroupType
   -> Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Text
   -> Text
   -> Text
   -> RuleGroupResponse)
-> Parser (Maybe RuleGroupType)
-> Parser
     (Maybe Text
      -> Maybe (NonEmpty Tag)
      -> Text
      -> Text
      -> Text
      -> RuleGroupResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe RuleGroupType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
            Parser
  (Maybe Text
   -> Maybe (NonEmpty Tag)
   -> Text
   -> Text
   -> Text
   -> RuleGroupResponse)
-> Parser (Maybe Text)
-> Parser
     (Maybe (NonEmpty Tag) -> Text -> Text -> Text -> RuleGroupResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Description")
            Parser
  (Maybe (NonEmpty Tag) -> Text -> Text -> Text -> RuleGroupResponse)
-> Parser (Maybe (NonEmpty Tag))
-> Parser (Text -> Text -> Text -> RuleGroupResponse)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (NonEmpty Tag))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Tags")
            Parser (Text -> Text -> Text -> RuleGroupResponse)
-> Parser Text -> Parser (Text -> Text -> RuleGroupResponse)
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
"RuleGroupArn")
            Parser (Text -> Text -> RuleGroupResponse)
-> Parser Text -> Parser (Text -> RuleGroupResponse)
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
"RuleGroupName")
            Parser (Text -> RuleGroupResponse)
-> Parser Text -> Parser RuleGroupResponse
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
"RuleGroupId")
      )

instance Prelude.Hashable RuleGroupResponse

instance Prelude.NFData RuleGroupResponse