{-# 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.Route53Resolver.Types.FirewallRuleGroupMetadata
-- 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.Route53Resolver.Types.FirewallRuleGroupMetadata where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.Route53Resolver.Types.ShareStatus

-- | Minimal high-level information for a firewall rule group. The action
-- ListFirewallRuleGroups returns an array of these objects.
--
-- To retrieve full information for a firewall rule group, call
-- GetFirewallRuleGroup and ListFirewallRules.
--
-- /See:/ 'newFirewallRuleGroupMetadata' smart constructor.
data FirewallRuleGroupMetadata = FirewallRuleGroupMetadata'
  { -- | The ARN (Amazon Resource Name) of the rule group.
    FirewallRuleGroupMetadata -> Maybe Text
arn :: Prelude.Maybe Prelude.Text,
    -- | A unique string defined by you to identify the request. This allows you
    -- to retry failed requests without the risk of running the operation
    -- twice. This can be any unique string, for example, a timestamp.
    FirewallRuleGroupMetadata -> Maybe Text
creatorRequestId :: Prelude.Maybe Prelude.Text,
    -- | Whether the rule group is shared with other Amazon Web Services
    -- accounts, or was shared with the current account by another Amazon Web
    -- Services account. Sharing is configured through Resource Access Manager
    -- (RAM).
    FirewallRuleGroupMetadata -> Maybe ShareStatus
shareStatus :: Prelude.Maybe ShareStatus,
    -- | The Amazon Web Services account ID for the account that created the rule
    -- group. When a rule group is shared with your account, this is the
    -- account that has shared the rule group with you.
    FirewallRuleGroupMetadata -> Maybe Text
ownerId :: Prelude.Maybe Prelude.Text,
    -- | The name of the rule group.
    FirewallRuleGroupMetadata -> Maybe Text
name :: Prelude.Maybe Prelude.Text,
    -- | The ID of the rule group.
    FirewallRuleGroupMetadata -> Maybe Text
id :: Prelude.Maybe Prelude.Text
  }
  deriving (FirewallRuleGroupMetadata -> FirewallRuleGroupMetadata -> Bool
(FirewallRuleGroupMetadata -> FirewallRuleGroupMetadata -> Bool)
-> (FirewallRuleGroupMetadata -> FirewallRuleGroupMetadata -> Bool)
-> Eq FirewallRuleGroupMetadata
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FirewallRuleGroupMetadata -> FirewallRuleGroupMetadata -> Bool
$c/= :: FirewallRuleGroupMetadata -> FirewallRuleGroupMetadata -> Bool
== :: FirewallRuleGroupMetadata -> FirewallRuleGroupMetadata -> Bool
$c== :: FirewallRuleGroupMetadata -> FirewallRuleGroupMetadata -> Bool
Prelude.Eq, ReadPrec [FirewallRuleGroupMetadata]
ReadPrec FirewallRuleGroupMetadata
Int -> ReadS FirewallRuleGroupMetadata
ReadS [FirewallRuleGroupMetadata]
(Int -> ReadS FirewallRuleGroupMetadata)
-> ReadS [FirewallRuleGroupMetadata]
-> ReadPrec FirewallRuleGroupMetadata
-> ReadPrec [FirewallRuleGroupMetadata]
-> Read FirewallRuleGroupMetadata
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FirewallRuleGroupMetadata]
$creadListPrec :: ReadPrec [FirewallRuleGroupMetadata]
readPrec :: ReadPrec FirewallRuleGroupMetadata
$creadPrec :: ReadPrec FirewallRuleGroupMetadata
readList :: ReadS [FirewallRuleGroupMetadata]
$creadList :: ReadS [FirewallRuleGroupMetadata]
readsPrec :: Int -> ReadS FirewallRuleGroupMetadata
$creadsPrec :: Int -> ReadS FirewallRuleGroupMetadata
Prelude.Read, Int -> FirewallRuleGroupMetadata -> ShowS
[FirewallRuleGroupMetadata] -> ShowS
FirewallRuleGroupMetadata -> String
(Int -> FirewallRuleGroupMetadata -> ShowS)
-> (FirewallRuleGroupMetadata -> String)
-> ([FirewallRuleGroupMetadata] -> ShowS)
-> Show FirewallRuleGroupMetadata
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FirewallRuleGroupMetadata] -> ShowS
$cshowList :: [FirewallRuleGroupMetadata] -> ShowS
show :: FirewallRuleGroupMetadata -> String
$cshow :: FirewallRuleGroupMetadata -> String
showsPrec :: Int -> FirewallRuleGroupMetadata -> ShowS
$cshowsPrec :: Int -> FirewallRuleGroupMetadata -> ShowS
Prelude.Show, (forall x.
 FirewallRuleGroupMetadata -> Rep FirewallRuleGroupMetadata x)
-> (forall x.
    Rep FirewallRuleGroupMetadata x -> FirewallRuleGroupMetadata)
-> Generic FirewallRuleGroupMetadata
forall x.
Rep FirewallRuleGroupMetadata x -> FirewallRuleGroupMetadata
forall x.
FirewallRuleGroupMetadata -> Rep FirewallRuleGroupMetadata x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FirewallRuleGroupMetadata x -> FirewallRuleGroupMetadata
$cfrom :: forall x.
FirewallRuleGroupMetadata -> Rep FirewallRuleGroupMetadata x
Prelude.Generic)

-- |
-- Create a value of 'FirewallRuleGroupMetadata' 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:
--
-- 'arn', 'firewallRuleGroupMetadata_arn' - The ARN (Amazon Resource Name) of the rule group.
--
-- 'creatorRequestId', 'firewallRuleGroupMetadata_creatorRequestId' - A unique string defined by you to identify the request. This allows you
-- to retry failed requests without the risk of running the operation
-- twice. This can be any unique string, for example, a timestamp.
--
-- 'shareStatus', 'firewallRuleGroupMetadata_shareStatus' - Whether the rule group is shared with other Amazon Web Services
-- accounts, or was shared with the current account by another Amazon Web
-- Services account. Sharing is configured through Resource Access Manager
-- (RAM).
--
-- 'ownerId', 'firewallRuleGroupMetadata_ownerId' - The Amazon Web Services account ID for the account that created the rule
-- group. When a rule group is shared with your account, this is the
-- account that has shared the rule group with you.
--
-- 'name', 'firewallRuleGroupMetadata_name' - The name of the rule group.
--
-- 'id', 'firewallRuleGroupMetadata_id' - The ID of the rule group.
newFirewallRuleGroupMetadata ::
  FirewallRuleGroupMetadata
newFirewallRuleGroupMetadata :: FirewallRuleGroupMetadata
newFirewallRuleGroupMetadata =
  FirewallRuleGroupMetadata' :: Maybe Text
-> Maybe Text
-> Maybe ShareStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> FirewallRuleGroupMetadata
FirewallRuleGroupMetadata'
    { $sel:arn:FirewallRuleGroupMetadata' :: Maybe Text
arn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:creatorRequestId:FirewallRuleGroupMetadata' :: Maybe Text
creatorRequestId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:shareStatus:FirewallRuleGroupMetadata' :: Maybe ShareStatus
shareStatus = Maybe ShareStatus
forall a. Maybe a
Prelude.Nothing,
      $sel:ownerId:FirewallRuleGroupMetadata' :: Maybe Text
ownerId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:name:FirewallRuleGroupMetadata' :: Maybe Text
name = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:id:FirewallRuleGroupMetadata' :: Maybe Text
id = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ARN (Amazon Resource Name) of the rule group.
firewallRuleGroupMetadata_arn :: Lens.Lens' FirewallRuleGroupMetadata (Prelude.Maybe Prelude.Text)
firewallRuleGroupMetadata_arn :: (Maybe Text -> f (Maybe Text))
-> FirewallRuleGroupMetadata -> f FirewallRuleGroupMetadata
firewallRuleGroupMetadata_arn = (FirewallRuleGroupMetadata -> Maybe Text)
-> (FirewallRuleGroupMetadata
    -> Maybe Text -> FirewallRuleGroupMetadata)
-> Lens
     FirewallRuleGroupMetadata
     FirewallRuleGroupMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallRuleGroupMetadata' {Maybe Text
arn :: Maybe Text
$sel:arn:FirewallRuleGroupMetadata' :: FirewallRuleGroupMetadata -> Maybe Text
arn} -> Maybe Text
arn) (\s :: FirewallRuleGroupMetadata
s@FirewallRuleGroupMetadata' {} Maybe Text
a -> FirewallRuleGroupMetadata
s {$sel:arn:FirewallRuleGroupMetadata' :: Maybe Text
arn = Maybe Text
a} :: FirewallRuleGroupMetadata)

-- | A unique string defined by you to identify the request. This allows you
-- to retry failed requests without the risk of running the operation
-- twice. This can be any unique string, for example, a timestamp.
firewallRuleGroupMetadata_creatorRequestId :: Lens.Lens' FirewallRuleGroupMetadata (Prelude.Maybe Prelude.Text)
firewallRuleGroupMetadata_creatorRequestId :: (Maybe Text -> f (Maybe Text))
-> FirewallRuleGroupMetadata -> f FirewallRuleGroupMetadata
firewallRuleGroupMetadata_creatorRequestId = (FirewallRuleGroupMetadata -> Maybe Text)
-> (FirewallRuleGroupMetadata
    -> Maybe Text -> FirewallRuleGroupMetadata)
-> Lens
     FirewallRuleGroupMetadata
     FirewallRuleGroupMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallRuleGroupMetadata' {Maybe Text
creatorRequestId :: Maybe Text
$sel:creatorRequestId:FirewallRuleGroupMetadata' :: FirewallRuleGroupMetadata -> Maybe Text
creatorRequestId} -> Maybe Text
creatorRequestId) (\s :: FirewallRuleGroupMetadata
s@FirewallRuleGroupMetadata' {} Maybe Text
a -> FirewallRuleGroupMetadata
s {$sel:creatorRequestId:FirewallRuleGroupMetadata' :: Maybe Text
creatorRequestId = Maybe Text
a} :: FirewallRuleGroupMetadata)

-- | Whether the rule group is shared with other Amazon Web Services
-- accounts, or was shared with the current account by another Amazon Web
-- Services account. Sharing is configured through Resource Access Manager
-- (RAM).
firewallRuleGroupMetadata_shareStatus :: Lens.Lens' FirewallRuleGroupMetadata (Prelude.Maybe ShareStatus)
firewallRuleGroupMetadata_shareStatus :: (Maybe ShareStatus -> f (Maybe ShareStatus))
-> FirewallRuleGroupMetadata -> f FirewallRuleGroupMetadata
firewallRuleGroupMetadata_shareStatus = (FirewallRuleGroupMetadata -> Maybe ShareStatus)
-> (FirewallRuleGroupMetadata
    -> Maybe ShareStatus -> FirewallRuleGroupMetadata)
-> Lens
     FirewallRuleGroupMetadata
     FirewallRuleGroupMetadata
     (Maybe ShareStatus)
     (Maybe ShareStatus)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallRuleGroupMetadata' {Maybe ShareStatus
shareStatus :: Maybe ShareStatus
$sel:shareStatus:FirewallRuleGroupMetadata' :: FirewallRuleGroupMetadata -> Maybe ShareStatus
shareStatus} -> Maybe ShareStatus
shareStatus) (\s :: FirewallRuleGroupMetadata
s@FirewallRuleGroupMetadata' {} Maybe ShareStatus
a -> FirewallRuleGroupMetadata
s {$sel:shareStatus:FirewallRuleGroupMetadata' :: Maybe ShareStatus
shareStatus = Maybe ShareStatus
a} :: FirewallRuleGroupMetadata)

-- | The Amazon Web Services account ID for the account that created the rule
-- group. When a rule group is shared with your account, this is the
-- account that has shared the rule group with you.
firewallRuleGroupMetadata_ownerId :: Lens.Lens' FirewallRuleGroupMetadata (Prelude.Maybe Prelude.Text)
firewallRuleGroupMetadata_ownerId :: (Maybe Text -> f (Maybe Text))
-> FirewallRuleGroupMetadata -> f FirewallRuleGroupMetadata
firewallRuleGroupMetadata_ownerId = (FirewallRuleGroupMetadata -> Maybe Text)
-> (FirewallRuleGroupMetadata
    -> Maybe Text -> FirewallRuleGroupMetadata)
-> Lens
     FirewallRuleGroupMetadata
     FirewallRuleGroupMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallRuleGroupMetadata' {Maybe Text
ownerId :: Maybe Text
$sel:ownerId:FirewallRuleGroupMetadata' :: FirewallRuleGroupMetadata -> Maybe Text
ownerId} -> Maybe Text
ownerId) (\s :: FirewallRuleGroupMetadata
s@FirewallRuleGroupMetadata' {} Maybe Text
a -> FirewallRuleGroupMetadata
s {$sel:ownerId:FirewallRuleGroupMetadata' :: Maybe Text
ownerId = Maybe Text
a} :: FirewallRuleGroupMetadata)

-- | The name of the rule group.
firewallRuleGroupMetadata_name :: Lens.Lens' FirewallRuleGroupMetadata (Prelude.Maybe Prelude.Text)
firewallRuleGroupMetadata_name :: (Maybe Text -> f (Maybe Text))
-> FirewallRuleGroupMetadata -> f FirewallRuleGroupMetadata
firewallRuleGroupMetadata_name = (FirewallRuleGroupMetadata -> Maybe Text)
-> (FirewallRuleGroupMetadata
    -> Maybe Text -> FirewallRuleGroupMetadata)
-> Lens
     FirewallRuleGroupMetadata
     FirewallRuleGroupMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallRuleGroupMetadata' {Maybe Text
name :: Maybe Text
$sel:name:FirewallRuleGroupMetadata' :: FirewallRuleGroupMetadata -> Maybe Text
name} -> Maybe Text
name) (\s :: FirewallRuleGroupMetadata
s@FirewallRuleGroupMetadata' {} Maybe Text
a -> FirewallRuleGroupMetadata
s {$sel:name:FirewallRuleGroupMetadata' :: Maybe Text
name = Maybe Text
a} :: FirewallRuleGroupMetadata)

-- | The ID of the rule group.
firewallRuleGroupMetadata_id :: Lens.Lens' FirewallRuleGroupMetadata (Prelude.Maybe Prelude.Text)
firewallRuleGroupMetadata_id :: (Maybe Text -> f (Maybe Text))
-> FirewallRuleGroupMetadata -> f FirewallRuleGroupMetadata
firewallRuleGroupMetadata_id = (FirewallRuleGroupMetadata -> Maybe Text)
-> (FirewallRuleGroupMetadata
    -> Maybe Text -> FirewallRuleGroupMetadata)
-> Lens
     FirewallRuleGroupMetadata
     FirewallRuleGroupMetadata
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FirewallRuleGroupMetadata' {Maybe Text
id :: Maybe Text
$sel:id:FirewallRuleGroupMetadata' :: FirewallRuleGroupMetadata -> Maybe Text
id} -> Maybe Text
id) (\s :: FirewallRuleGroupMetadata
s@FirewallRuleGroupMetadata' {} Maybe Text
a -> FirewallRuleGroupMetadata
s {$sel:id:FirewallRuleGroupMetadata' :: Maybe Text
id = Maybe Text
a} :: FirewallRuleGroupMetadata)

instance Core.FromJSON FirewallRuleGroupMetadata where
  parseJSON :: Value -> Parser FirewallRuleGroupMetadata
parseJSON =
    String
-> (Object -> Parser FirewallRuleGroupMetadata)
-> Value
-> Parser FirewallRuleGroupMetadata
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FirewallRuleGroupMetadata"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe ShareStatus
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> FirewallRuleGroupMetadata
FirewallRuleGroupMetadata'
            (Maybe Text
 -> Maybe Text
 -> Maybe ShareStatus
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> FirewallRuleGroupMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe ShareStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> FirewallRuleGroupMetadata)
forall (f :: * -> *) a b. Functor 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
"Arn")
            Parser
  (Maybe Text
   -> Maybe ShareStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> FirewallRuleGroupMetadata)
-> Parser (Maybe Text)
-> Parser
     (Maybe ShareStatus
      -> Maybe Text
      -> Maybe Text
      -> Maybe Text
      -> FirewallRuleGroupMetadata)
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
"CreatorRequestId")
            Parser
  (Maybe ShareStatus
   -> Maybe Text
   -> Maybe Text
   -> Maybe Text
   -> FirewallRuleGroupMetadata)
-> Parser (Maybe ShareStatus)
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> FirewallRuleGroupMetadata)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ShareStatus)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ShareStatus")
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> FirewallRuleGroupMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> FirewallRuleGroupMetadata)
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
"OwnerId")
            Parser (Maybe Text -> Maybe Text -> FirewallRuleGroupMetadata)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> FirewallRuleGroupMetadata)
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
"Name")
            Parser (Maybe Text -> FirewallRuleGroupMetadata)
-> Parser (Maybe Text) -> Parser FirewallRuleGroupMetadata
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
"Id")
      )

instance Prelude.Hashable FirewallRuleGroupMetadata

instance Prelude.NFData FirewallRuleGroupMetadata