{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RecordWildCards #-}
{-# LANGUAGE StrictData #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE NoImplicitPrelude #-}
{-# OPTIONS_GHC -fno-warn-unused-binds #-}
{-# 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.DescribeRuleGroupMetadata
-- Copyright   : (c) 2013-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
--
-- High-level information about a rule group, returned by operations like
-- create and describe. You can use the information provided in the
-- metadata to retrieve and manage a rule group. You can retrieve all
-- objects for a rule group by calling DescribeRuleGroup.
module Amazonka.NetworkFirewall.DescribeRuleGroupMetadata
  ( -- * Creating a Request
    DescribeRuleGroupMetadata (..),
    newDescribeRuleGroupMetadata,

    -- * Request Lenses
    describeRuleGroupMetadata_ruleGroupArn,
    describeRuleGroupMetadata_ruleGroupName,
    describeRuleGroupMetadata_type,

    -- * Destructuring the Response
    DescribeRuleGroupMetadataResponse (..),
    newDescribeRuleGroupMetadataResponse,

    -- * Response Lenses
    describeRuleGroupMetadataResponse_capacity,
    describeRuleGroupMetadataResponse_description,
    describeRuleGroupMetadataResponse_lastModifiedTime,
    describeRuleGroupMetadataResponse_statefulRuleOptions,
    describeRuleGroupMetadataResponse_type,
    describeRuleGroupMetadataResponse_httpStatus,
    describeRuleGroupMetadataResponse_ruleGroupArn,
    describeRuleGroupMetadataResponse_ruleGroupName,
  )
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
import qualified Amazonka.Prelude as Prelude
import qualified Amazonka.Request as Request
import qualified Amazonka.Response as Response

-- | /See:/ 'newDescribeRuleGroupMetadata' smart constructor.
data DescribeRuleGroupMetadata = DescribeRuleGroupMetadata'
  { -- | The descriptive name of the rule group. You can\'t change the name of a
    -- rule group after you create it.
    --
    -- You must specify the ARN or the name, and you can specify both.
    DescribeRuleGroupMetadata -> Maybe Text
ruleGroupArn :: Prelude.Maybe Prelude.Text,
    -- | The descriptive name of the rule group. You can\'t change the name of a
    -- rule group after you create it.
    --
    -- You must specify the ARN or the name, and you can specify both.
    DescribeRuleGroupMetadata -> Maybe Text
ruleGroupName :: Prelude.Maybe Prelude.Text,
    -- | 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.
    --
    -- This setting is required for requests that do not include the
    -- @RuleGroupARN@.
    DescribeRuleGroupMetadata -> Maybe RuleGroupType
type' :: Prelude.Maybe RuleGroupType
  }
  deriving (DescribeRuleGroupMetadata -> DescribeRuleGroupMetadata -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRuleGroupMetadata -> DescribeRuleGroupMetadata -> Bool
$c/= :: DescribeRuleGroupMetadata -> DescribeRuleGroupMetadata -> Bool
== :: DescribeRuleGroupMetadata -> DescribeRuleGroupMetadata -> Bool
$c== :: DescribeRuleGroupMetadata -> DescribeRuleGroupMetadata -> Bool
Prelude.Eq, ReadPrec [DescribeRuleGroupMetadata]
ReadPrec DescribeRuleGroupMetadata
Int -> ReadS DescribeRuleGroupMetadata
ReadS [DescribeRuleGroupMetadata]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRuleGroupMetadata]
$creadListPrec :: ReadPrec [DescribeRuleGroupMetadata]
readPrec :: ReadPrec DescribeRuleGroupMetadata
$creadPrec :: ReadPrec DescribeRuleGroupMetadata
readList :: ReadS [DescribeRuleGroupMetadata]
$creadList :: ReadS [DescribeRuleGroupMetadata]
readsPrec :: Int -> ReadS DescribeRuleGroupMetadata
$creadsPrec :: Int -> ReadS DescribeRuleGroupMetadata
Prelude.Read, Int -> DescribeRuleGroupMetadata -> ShowS
[DescribeRuleGroupMetadata] -> ShowS
DescribeRuleGroupMetadata -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRuleGroupMetadata] -> ShowS
$cshowList :: [DescribeRuleGroupMetadata] -> ShowS
show :: DescribeRuleGroupMetadata -> String
$cshow :: DescribeRuleGroupMetadata -> String
showsPrec :: Int -> DescribeRuleGroupMetadata -> ShowS
$cshowsPrec :: Int -> DescribeRuleGroupMetadata -> ShowS
Prelude.Show, forall x.
Rep DescribeRuleGroupMetadata x -> DescribeRuleGroupMetadata
forall x.
DescribeRuleGroupMetadata -> Rep DescribeRuleGroupMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRuleGroupMetadata x -> DescribeRuleGroupMetadata
$cfrom :: forall x.
DescribeRuleGroupMetadata -> Rep DescribeRuleGroupMetadata x
Prelude.Generic)

-- |
-- Create a value of 'DescribeRuleGroupMetadata' 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:
--
-- 'ruleGroupArn', 'describeRuleGroupMetadata_ruleGroupArn' - The descriptive name of the rule group. You can\'t change the name of a
-- rule group after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
--
-- 'ruleGroupName', 'describeRuleGroupMetadata_ruleGroupName' - The descriptive name of the rule group. You can\'t change the name of a
-- rule group after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
--
-- 'type'', 'describeRuleGroupMetadata_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.
--
-- This setting is required for requests that do not include the
-- @RuleGroupARN@.
newDescribeRuleGroupMetadata ::
  DescribeRuleGroupMetadata
newDescribeRuleGroupMetadata :: DescribeRuleGroupMetadata
newDescribeRuleGroupMetadata =
  DescribeRuleGroupMetadata'
    { $sel:ruleGroupArn:DescribeRuleGroupMetadata' :: Maybe Text
ruleGroupArn =
        forall a. Maybe a
Prelude.Nothing,
      $sel:ruleGroupName:DescribeRuleGroupMetadata' :: Maybe Text
ruleGroupName = forall a. Maybe a
Prelude.Nothing,
      $sel:type':DescribeRuleGroupMetadata' :: Maybe RuleGroupType
type' = forall a. Maybe a
Prelude.Nothing
    }

-- | The descriptive name of the rule group. You can\'t change the name of a
-- rule group after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
describeRuleGroupMetadata_ruleGroupArn :: Lens.Lens' DescribeRuleGroupMetadata (Prelude.Maybe Prelude.Text)
describeRuleGroupMetadata_ruleGroupArn :: Lens' DescribeRuleGroupMetadata (Maybe Text)
describeRuleGroupMetadata_ruleGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupMetadata' {Maybe Text
ruleGroupArn :: Maybe Text
$sel:ruleGroupArn:DescribeRuleGroupMetadata' :: DescribeRuleGroupMetadata -> Maybe Text
ruleGroupArn} -> Maybe Text
ruleGroupArn) (\s :: DescribeRuleGroupMetadata
s@DescribeRuleGroupMetadata' {} Maybe Text
a -> DescribeRuleGroupMetadata
s {$sel:ruleGroupArn:DescribeRuleGroupMetadata' :: Maybe Text
ruleGroupArn = Maybe Text
a} :: DescribeRuleGroupMetadata)

-- | The descriptive name of the rule group. You can\'t change the name of a
-- rule group after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
describeRuleGroupMetadata_ruleGroupName :: Lens.Lens' DescribeRuleGroupMetadata (Prelude.Maybe Prelude.Text)
describeRuleGroupMetadata_ruleGroupName :: Lens' DescribeRuleGroupMetadata (Maybe Text)
describeRuleGroupMetadata_ruleGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupMetadata' {Maybe Text
ruleGroupName :: Maybe Text
$sel:ruleGroupName:DescribeRuleGroupMetadata' :: DescribeRuleGroupMetadata -> Maybe Text
ruleGroupName} -> Maybe Text
ruleGroupName) (\s :: DescribeRuleGroupMetadata
s@DescribeRuleGroupMetadata' {} Maybe Text
a -> DescribeRuleGroupMetadata
s {$sel:ruleGroupName:DescribeRuleGroupMetadata' :: Maybe Text
ruleGroupName = Maybe Text
a} :: DescribeRuleGroupMetadata)

-- | 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.
--
-- This setting is required for requests that do not include the
-- @RuleGroupARN@.
describeRuleGroupMetadata_type :: Lens.Lens' DescribeRuleGroupMetadata (Prelude.Maybe RuleGroupType)
describeRuleGroupMetadata_type :: Lens' DescribeRuleGroupMetadata (Maybe RuleGroupType)
describeRuleGroupMetadata_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupMetadata' {Maybe RuleGroupType
type' :: Maybe RuleGroupType
$sel:type':DescribeRuleGroupMetadata' :: DescribeRuleGroupMetadata -> Maybe RuleGroupType
type'} -> Maybe RuleGroupType
type') (\s :: DescribeRuleGroupMetadata
s@DescribeRuleGroupMetadata' {} Maybe RuleGroupType
a -> DescribeRuleGroupMetadata
s {$sel:type':DescribeRuleGroupMetadata' :: Maybe RuleGroupType
type' = Maybe RuleGroupType
a} :: DescribeRuleGroupMetadata)

instance Core.AWSRequest DescribeRuleGroupMetadata where
  type
    AWSResponse DescribeRuleGroupMetadata =
      DescribeRuleGroupMetadataResponse
  request :: (Service -> Service)
-> DescribeRuleGroupMetadata -> Request DescribeRuleGroupMetadata
request Service -> Service
overrides =
    forall a. (ToRequest a, ToJSON a) => Service -> a -> Request a
Request.postJSON (Service -> Service
overrides Service
defaultService)
  response :: forall (m :: * -> *).
MonadResource m =>
(ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy DescribeRuleGroupMetadata
-> ClientResponse ClientBody
-> m (Either
        Error (ClientResponse (AWSResponse DescribeRuleGroupMetadata)))
response =
    forall (m :: * -> *) a.
MonadResource m =>
(Int -> ResponseHeaders -> Object -> Either String (AWSResponse a))
-> (ByteStringLazy -> IO ByteStringLazy)
-> Service
-> Proxy a
-> ClientResponse ClientBody
-> m (Either Error (ClientResponse (AWSResponse a)))
Response.receiveJSON
      ( \Int
s ResponseHeaders
h Object
x ->
          Maybe Int
-> Maybe Text
-> Maybe POSIX
-> Maybe StatefulRuleOptions
-> Maybe RuleGroupType
-> Int
-> Text
-> Text
-> DescribeRuleGroupMetadataResponse
DescribeRuleGroupMetadataResponse'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Either String (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 -> Either String (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 -> Either String (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 -> Either String (Maybe a)
Data..?> Key
"StatefulRuleOptions")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String (Maybe a)
Data..?> Key
"Type")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (forall (f :: * -> *) a. Applicative f => a -> f a
Prelude.pure (forall a. Enum a => a -> Int
Prelude.fromEnum Int
s))
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Either String 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 -> Either String a
Data..:> Key
"RuleGroupName")
      )

instance Prelude.Hashable DescribeRuleGroupMetadata where
  hashWithSalt :: Int -> DescribeRuleGroupMetadata -> Int
hashWithSalt Int
_salt DescribeRuleGroupMetadata' {Maybe Text
Maybe RuleGroupType
type' :: Maybe RuleGroupType
ruleGroupName :: Maybe Text
ruleGroupArn :: Maybe Text
$sel:type':DescribeRuleGroupMetadata' :: DescribeRuleGroupMetadata -> Maybe RuleGroupType
$sel:ruleGroupName:DescribeRuleGroupMetadata' :: DescribeRuleGroupMetadata -> Maybe Text
$sel:ruleGroupArn:DescribeRuleGroupMetadata' :: DescribeRuleGroupMetadata -> Maybe Text
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleGroupArn
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
ruleGroupName
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe RuleGroupType
type'

instance Prelude.NFData DescribeRuleGroupMetadata where
  rnf :: DescribeRuleGroupMetadata -> ()
rnf DescribeRuleGroupMetadata' {Maybe Text
Maybe RuleGroupType
type' :: Maybe RuleGroupType
ruleGroupName :: Maybe Text
ruleGroupArn :: Maybe Text
$sel:type':DescribeRuleGroupMetadata' :: DescribeRuleGroupMetadata -> Maybe RuleGroupType
$sel:ruleGroupName:DescribeRuleGroupMetadata' :: DescribeRuleGroupMetadata -> Maybe Text
$sel:ruleGroupArn:DescribeRuleGroupMetadata' :: DescribeRuleGroupMetadata -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ruleGroupArn
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
ruleGroupName
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe RuleGroupType
type'

instance Data.ToHeaders DescribeRuleGroupMetadata where
  toHeaders :: DescribeRuleGroupMetadata -> ResponseHeaders
toHeaders =
    forall a b. a -> b -> a
Prelude.const
      ( forall a. Monoid a => [a] -> a
Prelude.mconcat
          [ HeaderName
"X-Amz-Target"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"NetworkFirewall_20201112.DescribeRuleGroupMetadata" ::
                          Prelude.ByteString
                      ),
            HeaderName
"Content-Type"
              forall a. ToHeader a => HeaderName -> a -> ResponseHeaders
Data.=# ( ByteString
"application/x-amz-json-1.0" ::
                          Prelude.ByteString
                      )
          ]
      )

instance Data.ToJSON DescribeRuleGroupMetadata where
  toJSON :: DescribeRuleGroupMetadata -> Value
toJSON DescribeRuleGroupMetadata' {Maybe Text
Maybe RuleGroupType
type' :: Maybe RuleGroupType
ruleGroupName :: Maybe Text
ruleGroupArn :: Maybe Text
$sel:type':DescribeRuleGroupMetadata' :: DescribeRuleGroupMetadata -> Maybe RuleGroupType
$sel:ruleGroupName:DescribeRuleGroupMetadata' :: DescribeRuleGroupMetadata -> Maybe Text
$sel:ruleGroupArn:DescribeRuleGroupMetadata' :: DescribeRuleGroupMetadata -> Maybe Text
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"RuleGroupArn" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ruleGroupArn,
            (Key
"RuleGroupName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
ruleGroupName,
            (Key
"Type" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe RuleGroupType
type'
          ]
      )

instance Data.ToPath DescribeRuleGroupMetadata where
  toPath :: DescribeRuleGroupMetadata -> ByteString
toPath = forall a b. a -> b -> a
Prelude.const ByteString
"/"

instance Data.ToQuery DescribeRuleGroupMetadata where
  toQuery :: DescribeRuleGroupMetadata -> QueryString
toQuery = forall a b. a -> b -> a
Prelude.const forall a. Monoid a => a
Prelude.mempty

-- | /See:/ 'newDescribeRuleGroupMetadataResponse' smart constructor.
data DescribeRuleGroupMetadataResponse = DescribeRuleGroupMetadataResponse'
  { -- | 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@.
    DescribeRuleGroupMetadataResponse -> Maybe Int
capacity :: Prelude.Maybe Prelude.Int,
    -- | Returns the metadata objects for the specified rule group.
    DescribeRuleGroupMetadataResponse -> Maybe Text
description :: Prelude.Maybe Prelude.Text,
    -- | The last time that the rule group was changed.
    DescribeRuleGroupMetadataResponse -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Data.POSIX,
    DescribeRuleGroupMetadataResponse -> Maybe StatefulRuleOptions
statefulRuleOptions :: Prelude.Maybe StatefulRuleOptions,
    -- | 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.
    --
    -- This setting is required for requests that do not include the
    -- @RuleGroupARN@.
    DescribeRuleGroupMetadataResponse -> Maybe RuleGroupType
type' :: Prelude.Maybe RuleGroupType,
    -- | The response's http status code.
    DescribeRuleGroupMetadataResponse -> Int
httpStatus :: Prelude.Int,
    -- | The descriptive name of the rule group. You can\'t change the name of a
    -- rule group after you create it.
    --
    -- You must specify the ARN or the name, and you can specify both.
    DescribeRuleGroupMetadataResponse -> 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.
    --
    -- You must specify the ARN or the name, and you can specify both.
    DescribeRuleGroupMetadataResponse -> Text
ruleGroupName :: Prelude.Text
  }
  deriving (DescribeRuleGroupMetadataResponse
-> DescribeRuleGroupMetadataResponse -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: DescribeRuleGroupMetadataResponse
-> DescribeRuleGroupMetadataResponse -> Bool
$c/= :: DescribeRuleGroupMetadataResponse
-> DescribeRuleGroupMetadataResponse -> Bool
== :: DescribeRuleGroupMetadataResponse
-> DescribeRuleGroupMetadataResponse -> Bool
$c== :: DescribeRuleGroupMetadataResponse
-> DescribeRuleGroupMetadataResponse -> Bool
Prelude.Eq, ReadPrec [DescribeRuleGroupMetadataResponse]
ReadPrec DescribeRuleGroupMetadataResponse
Int -> ReadS DescribeRuleGroupMetadataResponse
ReadS [DescribeRuleGroupMetadataResponse]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [DescribeRuleGroupMetadataResponse]
$creadListPrec :: ReadPrec [DescribeRuleGroupMetadataResponse]
readPrec :: ReadPrec DescribeRuleGroupMetadataResponse
$creadPrec :: ReadPrec DescribeRuleGroupMetadataResponse
readList :: ReadS [DescribeRuleGroupMetadataResponse]
$creadList :: ReadS [DescribeRuleGroupMetadataResponse]
readsPrec :: Int -> ReadS DescribeRuleGroupMetadataResponse
$creadsPrec :: Int -> ReadS DescribeRuleGroupMetadataResponse
Prelude.Read, Int -> DescribeRuleGroupMetadataResponse -> ShowS
[DescribeRuleGroupMetadataResponse] -> ShowS
DescribeRuleGroupMetadataResponse -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [DescribeRuleGroupMetadataResponse] -> ShowS
$cshowList :: [DescribeRuleGroupMetadataResponse] -> ShowS
show :: DescribeRuleGroupMetadataResponse -> String
$cshow :: DescribeRuleGroupMetadataResponse -> String
showsPrec :: Int -> DescribeRuleGroupMetadataResponse -> ShowS
$cshowsPrec :: Int -> DescribeRuleGroupMetadataResponse -> ShowS
Prelude.Show, forall x.
Rep DescribeRuleGroupMetadataResponse x
-> DescribeRuleGroupMetadataResponse
forall x.
DescribeRuleGroupMetadataResponse
-> Rep DescribeRuleGroupMetadataResponse x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep DescribeRuleGroupMetadataResponse x
-> DescribeRuleGroupMetadataResponse
$cfrom :: forall x.
DescribeRuleGroupMetadataResponse
-> Rep DescribeRuleGroupMetadataResponse x
Prelude.Generic)

-- |
-- Create a value of 'DescribeRuleGroupMetadataResponse' 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', 'describeRuleGroupMetadataResponse_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@.
--
-- 'description', 'describeRuleGroupMetadataResponse_description' - Returns the metadata objects for the specified rule group.
--
-- 'lastModifiedTime', 'describeRuleGroupMetadataResponse_lastModifiedTime' - The last time that the rule group was changed.
--
-- 'statefulRuleOptions', 'describeRuleGroupMetadataResponse_statefulRuleOptions' - Undocumented member.
--
-- 'type'', 'describeRuleGroupMetadataResponse_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.
--
-- This setting is required for requests that do not include the
-- @RuleGroupARN@.
--
-- 'httpStatus', 'describeRuleGroupMetadataResponse_httpStatus' - The response's http status code.
--
-- 'ruleGroupArn', 'describeRuleGroupMetadataResponse_ruleGroupArn' - The descriptive name of the rule group. You can\'t change the name of a
-- rule group after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
--
-- 'ruleGroupName', 'describeRuleGroupMetadataResponse_ruleGroupName' - The descriptive name of the rule group. You can\'t change the name of a
-- rule group after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
newDescribeRuleGroupMetadataResponse ::
  -- | 'httpStatus'
  Prelude.Int ->
  -- | 'ruleGroupArn'
  Prelude.Text ->
  -- | 'ruleGroupName'
  Prelude.Text ->
  DescribeRuleGroupMetadataResponse
newDescribeRuleGroupMetadataResponse :: Int -> Text -> Text -> DescribeRuleGroupMetadataResponse
newDescribeRuleGroupMetadataResponse
  Int
pHttpStatus_
  Text
pRuleGroupArn_
  Text
pRuleGroupName_ =
    DescribeRuleGroupMetadataResponse'
      { $sel:capacity:DescribeRuleGroupMetadataResponse' :: Maybe Int
capacity =
          forall a. Maybe a
Prelude.Nothing,
        $sel:description:DescribeRuleGroupMetadataResponse' :: Maybe Text
description = forall a. Maybe a
Prelude.Nothing,
        $sel:lastModifiedTime:DescribeRuleGroupMetadataResponse' :: Maybe POSIX
lastModifiedTime = forall a. Maybe a
Prelude.Nothing,
        $sel:statefulRuleOptions:DescribeRuleGroupMetadataResponse' :: Maybe StatefulRuleOptions
statefulRuleOptions = forall a. Maybe a
Prelude.Nothing,
        $sel:type':DescribeRuleGroupMetadataResponse' :: Maybe RuleGroupType
type' = forall a. Maybe a
Prelude.Nothing,
        $sel:httpStatus:DescribeRuleGroupMetadataResponse' :: Int
httpStatus = Int
pHttpStatus_,
        $sel:ruleGroupArn:DescribeRuleGroupMetadataResponse' :: Text
ruleGroupArn = Text
pRuleGroupArn_,
        $sel:ruleGroupName:DescribeRuleGroupMetadataResponse' :: Text
ruleGroupName = Text
pRuleGroupName_
      }

-- | 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@.
describeRuleGroupMetadataResponse_capacity :: Lens.Lens' DescribeRuleGroupMetadataResponse (Prelude.Maybe Prelude.Int)
describeRuleGroupMetadataResponse_capacity :: Lens' DescribeRuleGroupMetadataResponse (Maybe Int)
describeRuleGroupMetadataResponse_capacity = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupMetadataResponse' {Maybe Int
capacity :: Maybe Int
$sel:capacity:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Maybe Int
capacity} -> Maybe Int
capacity) (\s :: DescribeRuleGroupMetadataResponse
s@DescribeRuleGroupMetadataResponse' {} Maybe Int
a -> DescribeRuleGroupMetadataResponse
s {$sel:capacity:DescribeRuleGroupMetadataResponse' :: Maybe Int
capacity = Maybe Int
a} :: DescribeRuleGroupMetadataResponse)

-- | Returns the metadata objects for the specified rule group.
describeRuleGroupMetadataResponse_description :: Lens.Lens' DescribeRuleGroupMetadataResponse (Prelude.Maybe Prelude.Text)
describeRuleGroupMetadataResponse_description :: Lens' DescribeRuleGroupMetadataResponse (Maybe Text)
describeRuleGroupMetadataResponse_description = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupMetadataResponse' {Maybe Text
description :: Maybe Text
$sel:description:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Maybe Text
description} -> Maybe Text
description) (\s :: DescribeRuleGroupMetadataResponse
s@DescribeRuleGroupMetadataResponse' {} Maybe Text
a -> DescribeRuleGroupMetadataResponse
s {$sel:description:DescribeRuleGroupMetadataResponse' :: Maybe Text
description = Maybe Text
a} :: DescribeRuleGroupMetadataResponse)

-- | The last time that the rule group was changed.
describeRuleGroupMetadataResponse_lastModifiedTime :: Lens.Lens' DescribeRuleGroupMetadataResponse (Prelude.Maybe Prelude.UTCTime)
describeRuleGroupMetadataResponse_lastModifiedTime :: Lens' DescribeRuleGroupMetadataResponse (Maybe UTCTime)
describeRuleGroupMetadataResponse_lastModifiedTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupMetadataResponse' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: DescribeRuleGroupMetadataResponse
s@DescribeRuleGroupMetadataResponse' {} Maybe POSIX
a -> DescribeRuleGroupMetadataResponse
s {$sel:lastModifiedTime:DescribeRuleGroupMetadataResponse' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: DescribeRuleGroupMetadataResponse) 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

-- | Undocumented member.
describeRuleGroupMetadataResponse_statefulRuleOptions :: Lens.Lens' DescribeRuleGroupMetadataResponse (Prelude.Maybe StatefulRuleOptions)
describeRuleGroupMetadataResponse_statefulRuleOptions :: Lens' DescribeRuleGroupMetadataResponse (Maybe StatefulRuleOptions)
describeRuleGroupMetadataResponse_statefulRuleOptions = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupMetadataResponse' {Maybe StatefulRuleOptions
statefulRuleOptions :: Maybe StatefulRuleOptions
$sel:statefulRuleOptions:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Maybe StatefulRuleOptions
statefulRuleOptions} -> Maybe StatefulRuleOptions
statefulRuleOptions) (\s :: DescribeRuleGroupMetadataResponse
s@DescribeRuleGroupMetadataResponse' {} Maybe StatefulRuleOptions
a -> DescribeRuleGroupMetadataResponse
s {$sel:statefulRuleOptions:DescribeRuleGroupMetadataResponse' :: Maybe StatefulRuleOptions
statefulRuleOptions = Maybe StatefulRuleOptions
a} :: DescribeRuleGroupMetadataResponse)

-- | 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.
--
-- This setting is required for requests that do not include the
-- @RuleGroupARN@.
describeRuleGroupMetadataResponse_type :: Lens.Lens' DescribeRuleGroupMetadataResponse (Prelude.Maybe RuleGroupType)
describeRuleGroupMetadataResponse_type :: Lens' DescribeRuleGroupMetadataResponse (Maybe RuleGroupType)
describeRuleGroupMetadataResponse_type = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupMetadataResponse' {Maybe RuleGroupType
type' :: Maybe RuleGroupType
$sel:type':DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Maybe RuleGroupType
type'} -> Maybe RuleGroupType
type') (\s :: DescribeRuleGroupMetadataResponse
s@DescribeRuleGroupMetadataResponse' {} Maybe RuleGroupType
a -> DescribeRuleGroupMetadataResponse
s {$sel:type':DescribeRuleGroupMetadataResponse' :: Maybe RuleGroupType
type' = Maybe RuleGroupType
a} :: DescribeRuleGroupMetadataResponse)

-- | The response's http status code.
describeRuleGroupMetadataResponse_httpStatus :: Lens.Lens' DescribeRuleGroupMetadataResponse Prelude.Int
describeRuleGroupMetadataResponse_httpStatus :: Lens' DescribeRuleGroupMetadataResponse Int
describeRuleGroupMetadataResponse_httpStatus = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupMetadataResponse' {Int
httpStatus :: Int
$sel:httpStatus:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Int
httpStatus} -> Int
httpStatus) (\s :: DescribeRuleGroupMetadataResponse
s@DescribeRuleGroupMetadataResponse' {} Int
a -> DescribeRuleGroupMetadataResponse
s {$sel:httpStatus:DescribeRuleGroupMetadataResponse' :: Int
httpStatus = Int
a} :: DescribeRuleGroupMetadataResponse)

-- | The descriptive name of the rule group. You can\'t change the name of a
-- rule group after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
describeRuleGroupMetadataResponse_ruleGroupArn :: Lens.Lens' DescribeRuleGroupMetadataResponse Prelude.Text
describeRuleGroupMetadataResponse_ruleGroupArn :: Lens' DescribeRuleGroupMetadataResponse Text
describeRuleGroupMetadataResponse_ruleGroupArn = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupMetadataResponse' {Text
ruleGroupArn :: Text
$sel:ruleGroupArn:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Text
ruleGroupArn} -> Text
ruleGroupArn) (\s :: DescribeRuleGroupMetadataResponse
s@DescribeRuleGroupMetadataResponse' {} Text
a -> DescribeRuleGroupMetadataResponse
s {$sel:ruleGroupArn:DescribeRuleGroupMetadataResponse' :: Text
ruleGroupArn = Text
a} :: DescribeRuleGroupMetadataResponse)

-- | The descriptive name of the rule group. You can\'t change the name of a
-- rule group after you create it.
--
-- You must specify the ARN or the name, and you can specify both.
describeRuleGroupMetadataResponse_ruleGroupName :: Lens.Lens' DescribeRuleGroupMetadataResponse Prelude.Text
describeRuleGroupMetadataResponse_ruleGroupName :: Lens' DescribeRuleGroupMetadataResponse Text
describeRuleGroupMetadataResponse_ruleGroupName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\DescribeRuleGroupMetadataResponse' {Text
ruleGroupName :: Text
$sel:ruleGroupName:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Text
ruleGroupName} -> Text
ruleGroupName) (\s :: DescribeRuleGroupMetadataResponse
s@DescribeRuleGroupMetadataResponse' {} Text
a -> DescribeRuleGroupMetadataResponse
s {$sel:ruleGroupName:DescribeRuleGroupMetadataResponse' :: Text
ruleGroupName = Text
a} :: DescribeRuleGroupMetadataResponse)

instance
  Prelude.NFData
    DescribeRuleGroupMetadataResponse
  where
  rnf :: DescribeRuleGroupMetadataResponse -> ()
rnf DescribeRuleGroupMetadataResponse' {Int
Maybe Int
Maybe Text
Maybe POSIX
Maybe RuleGroupType
Maybe StatefulRuleOptions
Text
ruleGroupName :: Text
ruleGroupArn :: Text
httpStatus :: Int
type' :: Maybe RuleGroupType
statefulRuleOptions :: Maybe StatefulRuleOptions
lastModifiedTime :: Maybe POSIX
description :: Maybe Text
capacity :: Maybe Int
$sel:ruleGroupName:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Text
$sel:ruleGroupArn:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Text
$sel:httpStatus:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Int
$sel:type':DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Maybe RuleGroupType
$sel:statefulRuleOptions:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Maybe StatefulRuleOptions
$sel:lastModifiedTime:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Maybe POSIX
$sel:description:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> Maybe Text
$sel:capacity:DescribeRuleGroupMetadataResponse' :: DescribeRuleGroupMetadataResponse -> 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 Text
description
      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 StatefulRuleOptions
statefulRuleOptions
      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 Int
httpStatus
      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