{-# 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.AppsListDataSummary
-- 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.AppsListDataSummary where

import qualified Amazonka.Core as Core
import Amazonka.FMS.Types.App
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'AppsListDataSummary' 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:
--
-- 'listArn', 'appsListDataSummary_listArn' - The Amazon Resource Name (ARN) of the applications list.
--
-- 'appsList', 'appsListDataSummary_appsList' - An array of @App@ objects in the Firewall Manager applications list.
--
-- 'listId', 'appsListDataSummary_listId' - The ID of the applications list.
--
-- 'listName', 'appsListDataSummary_listName' - The name of the applications list.
newAppsListDataSummary ::
  AppsListDataSummary
newAppsListDataSummary :: AppsListDataSummary
newAppsListDataSummary =
  AppsListDataSummary' :: Maybe Text
-> Maybe [App] -> Maybe Text -> Maybe Text -> AppsListDataSummary
AppsListDataSummary'
    { $sel:listArn:AppsListDataSummary' :: Maybe Text
listArn = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:appsList:AppsListDataSummary' :: Maybe [App]
appsList = Maybe [App]
forall a. Maybe a
Prelude.Nothing,
      $sel:listId:AppsListDataSummary' :: Maybe Text
listId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:listName:AppsListDataSummary' :: Maybe Text
listName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The Amazon Resource Name (ARN) of the applications list.
appsListDataSummary_listArn :: Lens.Lens' AppsListDataSummary (Prelude.Maybe Prelude.Text)
appsListDataSummary_listArn :: (Maybe Text -> f (Maybe Text))
-> AppsListDataSummary -> f AppsListDataSummary
appsListDataSummary_listArn = (AppsListDataSummary -> Maybe Text)
-> (AppsListDataSummary -> Maybe Text -> AppsListDataSummary)
-> Lens
     AppsListDataSummary AppsListDataSummary (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppsListDataSummary' {Maybe Text
listArn :: Maybe Text
$sel:listArn:AppsListDataSummary' :: AppsListDataSummary -> Maybe Text
listArn} -> Maybe Text
listArn) (\s :: AppsListDataSummary
s@AppsListDataSummary' {} Maybe Text
a -> AppsListDataSummary
s {$sel:listArn:AppsListDataSummary' :: Maybe Text
listArn = Maybe Text
a} :: AppsListDataSummary)

-- | An array of @App@ objects in the Firewall Manager applications list.
appsListDataSummary_appsList :: Lens.Lens' AppsListDataSummary (Prelude.Maybe [App])
appsListDataSummary_appsList :: (Maybe [App] -> f (Maybe [App]))
-> AppsListDataSummary -> f AppsListDataSummary
appsListDataSummary_appsList = (AppsListDataSummary -> Maybe [App])
-> (AppsListDataSummary -> Maybe [App] -> AppsListDataSummary)
-> Lens
     AppsListDataSummary AppsListDataSummary (Maybe [App]) (Maybe [App])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AppsListDataSummary' {Maybe [App]
appsList :: Maybe [App]
$sel:appsList:AppsListDataSummary' :: AppsListDataSummary -> Maybe [App]
appsList} -> Maybe [App]
appsList) (\s :: AppsListDataSummary
s@AppsListDataSummary' {} Maybe [App]
a -> AppsListDataSummary
s {$sel:appsList:AppsListDataSummary' :: Maybe [App]
appsList = Maybe [App]
a} :: AppsListDataSummary) ((Maybe [App] -> f (Maybe [App]))
 -> AppsListDataSummary -> f AppsListDataSummary)
-> ((Maybe [App] -> f (Maybe [App]))
    -> Maybe [App] -> f (Maybe [App]))
-> (Maybe [App] -> f (Maybe [App]))
-> AppsListDataSummary
-> f AppsListDataSummary
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [App] [App] [App] [App]
-> Iso (Maybe [App]) (Maybe [App]) (Maybe [App]) (Maybe [App])
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 [App] [App] [App] [App]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

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

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

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

instance Prelude.NFData AppsListDataSummary