{-# 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.FMS.Types.ProtocolsListDataSummary
-- 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.FMS.Types.ProtocolsListDataSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Details of the Firewall Manager protocols list.
--
-- /See:/ 'newProtocolsListDataSummary' smart constructor.
data ProtocolsListDataSummary = ProtocolsListDataSummary'
  { -- | An array of protocols in the Firewall Manager protocols list.
    ProtocolsListDataSummary -> Maybe [Text]
protocolsList :: Prelude.Maybe [Prelude.Text],
    -- | The Amazon Resource Name (ARN) of the specified protocols list.
    ProtocolsListDataSummary -> Maybe Text
listArn :: Prelude.Maybe Prelude.Text,
    -- | The ID of the specified protocols list.
    ProtocolsListDataSummary -> Maybe Text
listId :: Prelude.Maybe Prelude.Text,
    -- | The name of the specified protocols list.
    ProtocolsListDataSummary -> Maybe Text
listName :: Prelude.Maybe Prelude.Text
  }
  deriving (ProtocolsListDataSummary -> ProtocolsListDataSummary -> Bool
(ProtocolsListDataSummary -> ProtocolsListDataSummary -> Bool)
-> (ProtocolsListDataSummary -> ProtocolsListDataSummary -> Bool)
-> Eq ProtocolsListDataSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ProtocolsListDataSummary -> ProtocolsListDataSummary -> Bool
$c/= :: ProtocolsListDataSummary -> ProtocolsListDataSummary -> Bool
== :: ProtocolsListDataSummary -> ProtocolsListDataSummary -> Bool
$c== :: ProtocolsListDataSummary -> ProtocolsListDataSummary -> Bool
Prelude.Eq, ReadPrec [ProtocolsListDataSummary]
ReadPrec ProtocolsListDataSummary
Int -> ReadS ProtocolsListDataSummary
ReadS [ProtocolsListDataSummary]
(Int -> ReadS ProtocolsListDataSummary)
-> ReadS [ProtocolsListDataSummary]
-> ReadPrec ProtocolsListDataSummary
-> ReadPrec [ProtocolsListDataSummary]
-> Read ProtocolsListDataSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ProtocolsListDataSummary]
$creadListPrec :: ReadPrec [ProtocolsListDataSummary]
readPrec :: ReadPrec ProtocolsListDataSummary
$creadPrec :: ReadPrec ProtocolsListDataSummary
readList :: ReadS [ProtocolsListDataSummary]
$creadList :: ReadS [ProtocolsListDataSummary]
readsPrec :: Int -> ReadS ProtocolsListDataSummary
$creadsPrec :: Int -> ReadS ProtocolsListDataSummary
Prelude.Read, Int -> ProtocolsListDataSummary -> ShowS
[ProtocolsListDataSummary] -> ShowS
ProtocolsListDataSummary -> String
(Int -> ProtocolsListDataSummary -> ShowS)
-> (ProtocolsListDataSummary -> String)
-> ([ProtocolsListDataSummary] -> ShowS)
-> Show ProtocolsListDataSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ProtocolsListDataSummary] -> ShowS
$cshowList :: [ProtocolsListDataSummary] -> ShowS
show :: ProtocolsListDataSummary -> String
$cshow :: ProtocolsListDataSummary -> String
showsPrec :: Int -> ProtocolsListDataSummary -> ShowS
$cshowsPrec :: Int -> ProtocolsListDataSummary -> ShowS
Prelude.Show, (forall x.
 ProtocolsListDataSummary -> Rep ProtocolsListDataSummary x)
-> (forall x.
    Rep ProtocolsListDataSummary x -> ProtocolsListDataSummary)
-> Generic ProtocolsListDataSummary
forall x.
Rep ProtocolsListDataSummary x -> ProtocolsListDataSummary
forall x.
ProtocolsListDataSummary -> Rep ProtocolsListDataSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep ProtocolsListDataSummary x -> ProtocolsListDataSummary
$cfrom :: forall x.
ProtocolsListDataSummary -> Rep ProtocolsListDataSummary x
Prelude.Generic)

-- |
-- Create a value of 'ProtocolsListDataSummary' 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:
--
-- 'protocolsList', 'protocolsListDataSummary_protocolsList' - An array of protocols in the Firewall Manager protocols list.
--
-- 'listArn', 'protocolsListDataSummary_listArn' - The Amazon Resource Name (ARN) of the specified protocols list.
--
-- 'listId', 'protocolsListDataSummary_listId' - The ID of the specified protocols list.
--
-- 'listName', 'protocolsListDataSummary_listName' - The name of the specified protocols list.
newProtocolsListDataSummary ::
  ProtocolsListDataSummary
newProtocolsListDataSummary :: ProtocolsListDataSummary
newProtocolsListDataSummary =
  ProtocolsListDataSummary' :: Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ProtocolsListDataSummary
ProtocolsListDataSummary'
    { $sel:protocolsList:ProtocolsListDataSummary' :: Maybe [Text]
protocolsList =
        Maybe [Text]
forall a. Maybe a
Prelude.Nothing,
      $sel:listArn:ProtocolsListDataSummary' :: Maybe Text
listArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:listId:ProtocolsListDataSummary' :: Maybe Text
listId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:listName:ProtocolsListDataSummary' :: Maybe Text
listName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | An array of protocols in the Firewall Manager protocols list.
protocolsListDataSummary_protocolsList :: Lens.Lens' ProtocolsListDataSummary (Prelude.Maybe [Prelude.Text])
protocolsListDataSummary_protocolsList :: (Maybe [Text] -> f (Maybe [Text]))
-> ProtocolsListDataSummary -> f ProtocolsListDataSummary
protocolsListDataSummary_protocolsList = (ProtocolsListDataSummary -> Maybe [Text])
-> (ProtocolsListDataSummary
    -> Maybe [Text] -> ProtocolsListDataSummary)
-> Lens
     ProtocolsListDataSummary
     ProtocolsListDataSummary
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtocolsListDataSummary' {Maybe [Text]
protocolsList :: Maybe [Text]
$sel:protocolsList:ProtocolsListDataSummary' :: ProtocolsListDataSummary -> Maybe [Text]
protocolsList} -> Maybe [Text]
protocolsList) (\s :: ProtocolsListDataSummary
s@ProtocolsListDataSummary' {} Maybe [Text]
a -> ProtocolsListDataSummary
s {$sel:protocolsList:ProtocolsListDataSummary' :: Maybe [Text]
protocolsList = Maybe [Text]
a} :: ProtocolsListDataSummary) ((Maybe [Text] -> f (Maybe [Text]))
 -> ProtocolsListDataSummary -> f ProtocolsListDataSummary)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> ProtocolsListDataSummary
-> f ProtocolsListDataSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
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 [Text] [Text] [Text] [Text]
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 specified protocols list.
protocolsListDataSummary_listArn :: Lens.Lens' ProtocolsListDataSummary (Prelude.Maybe Prelude.Text)
protocolsListDataSummary_listArn :: (Maybe Text -> f (Maybe Text))
-> ProtocolsListDataSummary -> f ProtocolsListDataSummary
protocolsListDataSummary_listArn = (ProtocolsListDataSummary -> Maybe Text)
-> (ProtocolsListDataSummary
    -> Maybe Text -> ProtocolsListDataSummary)
-> Lens
     ProtocolsListDataSummary
     ProtocolsListDataSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtocolsListDataSummary' {Maybe Text
listArn :: Maybe Text
$sel:listArn:ProtocolsListDataSummary' :: ProtocolsListDataSummary -> Maybe Text
listArn} -> Maybe Text
listArn) (\s :: ProtocolsListDataSummary
s@ProtocolsListDataSummary' {} Maybe Text
a -> ProtocolsListDataSummary
s {$sel:listArn:ProtocolsListDataSummary' :: Maybe Text
listArn = Maybe Text
a} :: ProtocolsListDataSummary)

-- | The ID of the specified protocols list.
protocolsListDataSummary_listId :: Lens.Lens' ProtocolsListDataSummary (Prelude.Maybe Prelude.Text)
protocolsListDataSummary_listId :: (Maybe Text -> f (Maybe Text))
-> ProtocolsListDataSummary -> f ProtocolsListDataSummary
protocolsListDataSummary_listId = (ProtocolsListDataSummary -> Maybe Text)
-> (ProtocolsListDataSummary
    -> Maybe Text -> ProtocolsListDataSummary)
-> Lens
     ProtocolsListDataSummary
     ProtocolsListDataSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtocolsListDataSummary' {Maybe Text
listId :: Maybe Text
$sel:listId:ProtocolsListDataSummary' :: ProtocolsListDataSummary -> Maybe Text
listId} -> Maybe Text
listId) (\s :: ProtocolsListDataSummary
s@ProtocolsListDataSummary' {} Maybe Text
a -> ProtocolsListDataSummary
s {$sel:listId:ProtocolsListDataSummary' :: Maybe Text
listId = Maybe Text
a} :: ProtocolsListDataSummary)

-- | The name of the specified protocols list.
protocolsListDataSummary_listName :: Lens.Lens' ProtocolsListDataSummary (Prelude.Maybe Prelude.Text)
protocolsListDataSummary_listName :: (Maybe Text -> f (Maybe Text))
-> ProtocolsListDataSummary -> f ProtocolsListDataSummary
protocolsListDataSummary_listName = (ProtocolsListDataSummary -> Maybe Text)
-> (ProtocolsListDataSummary
    -> Maybe Text -> ProtocolsListDataSummary)
-> Lens
     ProtocolsListDataSummary
     ProtocolsListDataSummary
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ProtocolsListDataSummary' {Maybe Text
listName :: Maybe Text
$sel:listName:ProtocolsListDataSummary' :: ProtocolsListDataSummary -> Maybe Text
listName} -> Maybe Text
listName) (\s :: ProtocolsListDataSummary
s@ProtocolsListDataSummary' {} Maybe Text
a -> ProtocolsListDataSummary
s {$sel:listName:ProtocolsListDataSummary' :: Maybe Text
listName = Maybe Text
a} :: ProtocolsListDataSummary)

instance Core.FromJSON ProtocolsListDataSummary where
  parseJSON :: Value -> Parser ProtocolsListDataSummary
parseJSON =
    String
-> (Object -> Parser ProtocolsListDataSummary)
-> Value
-> Parser ProtocolsListDataSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"ProtocolsListDataSummary"
      ( \Object
x ->
          Maybe [Text]
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> ProtocolsListDataSummary
ProtocolsListDataSummary'
            (Maybe [Text]
 -> Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> ProtocolsListDataSummary)
-> Parser (Maybe [Text])
-> Parser
     (Maybe Text
      -> Maybe Text -> Maybe Text -> ProtocolsListDataSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ProtocolsList" Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty)
            Parser
  (Maybe Text
   -> Maybe Text -> Maybe Text -> ProtocolsListDataSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> ProtocolsListDataSummary)
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
"ListArn")
            Parser (Maybe Text -> Maybe Text -> ProtocolsListDataSummary)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> ProtocolsListDataSummary)
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
"ListId")
            Parser (Maybe Text -> ProtocolsListDataSummary)
-> Parser (Maybe Text) -> Parser ProtocolsListDataSummary
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
"ListName")
      )

instance Prelude.Hashable ProtocolsListDataSummary

instance Prelude.NFData ProtocolsListDataSummary