{-# 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.WellArchitected.Types.NotificationSummary
-- 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.WellArchitected.Types.NotificationSummary where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
import Amazonka.WellArchitected.Types.LensUpgradeSummary
import Amazonka.WellArchitected.Types.NotificationType

-- | A notification summary return object.
--
-- /See:/ 'newNotificationSummary' smart constructor.
data NotificationSummary = NotificationSummary'
  { -- | Summary of lens upgrade.
    NotificationSummary -> Maybe LensUpgradeSummary
lensUpgradeSummary :: Prelude.Maybe LensUpgradeSummary,
    -- | The type of notification.
    NotificationSummary -> Maybe NotificationType
type' :: Prelude.Maybe NotificationType
  }
  deriving (NotificationSummary -> NotificationSummary -> Bool
(NotificationSummary -> NotificationSummary -> Bool)
-> (NotificationSummary -> NotificationSummary -> Bool)
-> Eq NotificationSummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NotificationSummary -> NotificationSummary -> Bool
$c/= :: NotificationSummary -> NotificationSummary -> Bool
== :: NotificationSummary -> NotificationSummary -> Bool
$c== :: NotificationSummary -> NotificationSummary -> Bool
Prelude.Eq, ReadPrec [NotificationSummary]
ReadPrec NotificationSummary
Int -> ReadS NotificationSummary
ReadS [NotificationSummary]
(Int -> ReadS NotificationSummary)
-> ReadS [NotificationSummary]
-> ReadPrec NotificationSummary
-> ReadPrec [NotificationSummary]
-> Read NotificationSummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NotificationSummary]
$creadListPrec :: ReadPrec [NotificationSummary]
readPrec :: ReadPrec NotificationSummary
$creadPrec :: ReadPrec NotificationSummary
readList :: ReadS [NotificationSummary]
$creadList :: ReadS [NotificationSummary]
readsPrec :: Int -> ReadS NotificationSummary
$creadsPrec :: Int -> ReadS NotificationSummary
Prelude.Read, Int -> NotificationSummary -> ShowS
[NotificationSummary] -> ShowS
NotificationSummary -> String
(Int -> NotificationSummary -> ShowS)
-> (NotificationSummary -> String)
-> ([NotificationSummary] -> ShowS)
-> Show NotificationSummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NotificationSummary] -> ShowS
$cshowList :: [NotificationSummary] -> ShowS
show :: NotificationSummary -> String
$cshow :: NotificationSummary -> String
showsPrec :: Int -> NotificationSummary -> ShowS
$cshowsPrec :: Int -> NotificationSummary -> ShowS
Prelude.Show, (forall x. NotificationSummary -> Rep NotificationSummary x)
-> (forall x. Rep NotificationSummary x -> NotificationSummary)
-> Generic NotificationSummary
forall x. Rep NotificationSummary x -> NotificationSummary
forall x. NotificationSummary -> Rep NotificationSummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NotificationSummary x -> NotificationSummary
$cfrom :: forall x. NotificationSummary -> Rep NotificationSummary x
Prelude.Generic)

-- |
-- Create a value of 'NotificationSummary' 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:
--
-- 'lensUpgradeSummary', 'notificationSummary_lensUpgradeSummary' - Summary of lens upgrade.
--
-- 'type'', 'notificationSummary_type' - The type of notification.
newNotificationSummary ::
  NotificationSummary
newNotificationSummary :: NotificationSummary
newNotificationSummary =
  NotificationSummary' :: Maybe LensUpgradeSummary
-> Maybe NotificationType -> NotificationSummary
NotificationSummary'
    { $sel:lensUpgradeSummary:NotificationSummary' :: Maybe LensUpgradeSummary
lensUpgradeSummary =
        Maybe LensUpgradeSummary
forall a. Maybe a
Prelude.Nothing,
      $sel:type':NotificationSummary' :: Maybe NotificationType
type' = Maybe NotificationType
forall a. Maybe a
Prelude.Nothing
    }

-- | Summary of lens upgrade.
notificationSummary_lensUpgradeSummary :: Lens.Lens' NotificationSummary (Prelude.Maybe LensUpgradeSummary)
notificationSummary_lensUpgradeSummary :: (Maybe LensUpgradeSummary -> f (Maybe LensUpgradeSummary))
-> NotificationSummary -> f NotificationSummary
notificationSummary_lensUpgradeSummary = (NotificationSummary -> Maybe LensUpgradeSummary)
-> (NotificationSummary
    -> Maybe LensUpgradeSummary -> NotificationSummary)
-> Lens
     NotificationSummary
     NotificationSummary
     (Maybe LensUpgradeSummary)
     (Maybe LensUpgradeSummary)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationSummary' {Maybe LensUpgradeSummary
lensUpgradeSummary :: Maybe LensUpgradeSummary
$sel:lensUpgradeSummary:NotificationSummary' :: NotificationSummary -> Maybe LensUpgradeSummary
lensUpgradeSummary} -> Maybe LensUpgradeSummary
lensUpgradeSummary) (\s :: NotificationSummary
s@NotificationSummary' {} Maybe LensUpgradeSummary
a -> NotificationSummary
s {$sel:lensUpgradeSummary:NotificationSummary' :: Maybe LensUpgradeSummary
lensUpgradeSummary = Maybe LensUpgradeSummary
a} :: NotificationSummary)

-- | The type of notification.
notificationSummary_type :: Lens.Lens' NotificationSummary (Prelude.Maybe NotificationType)
notificationSummary_type :: (Maybe NotificationType -> f (Maybe NotificationType))
-> NotificationSummary -> f NotificationSummary
notificationSummary_type = (NotificationSummary -> Maybe NotificationType)
-> (NotificationSummary
    -> Maybe NotificationType -> NotificationSummary)
-> Lens
     NotificationSummary
     NotificationSummary
     (Maybe NotificationType)
     (Maybe NotificationType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NotificationSummary' {Maybe NotificationType
type' :: Maybe NotificationType
$sel:type':NotificationSummary' :: NotificationSummary -> Maybe NotificationType
type'} -> Maybe NotificationType
type') (\s :: NotificationSummary
s@NotificationSummary' {} Maybe NotificationType
a -> NotificationSummary
s {$sel:type':NotificationSummary' :: Maybe NotificationType
type' = Maybe NotificationType
a} :: NotificationSummary)

instance Core.FromJSON NotificationSummary where
  parseJSON :: Value -> Parser NotificationSummary
parseJSON =
    String
-> (Object -> Parser NotificationSummary)
-> Value
-> Parser NotificationSummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"NotificationSummary"
      ( \Object
x ->
          Maybe LensUpgradeSummary
-> Maybe NotificationType -> NotificationSummary
NotificationSummary'
            (Maybe LensUpgradeSummary
 -> Maybe NotificationType -> NotificationSummary)
-> Parser (Maybe LensUpgradeSummary)
-> Parser (Maybe NotificationType -> NotificationSummary)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe LensUpgradeSummary)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"LensUpgradeSummary")
            Parser (Maybe NotificationType -> NotificationSummary)
-> Parser (Maybe NotificationType) -> Parser NotificationSummary
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NotificationType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Type")
      )

instance Prelude.Hashable NotificationSummary

instance Prelude.NFData NotificationSummary