{-# 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.DevOpsGuru.Types.ServiceInsightHealth
-- 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.DevOpsGuru.Types.ServiceInsightHealth where

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

-- | Contains the number of open proactive and reactive insights in an
-- analyzed AWS service.
--
-- /See:/ 'newServiceInsightHealth' smart constructor.
data ServiceInsightHealth = ServiceInsightHealth'
  { -- | The number of open reactive insights in the AWS service
    ServiceInsightHealth -> Maybe Int
openReactiveInsights :: Prelude.Maybe Prelude.Int,
    -- | The number of open proactive insights in the AWS service
    ServiceInsightHealth -> Maybe Int
openProactiveInsights :: Prelude.Maybe Prelude.Int
  }
  deriving (ServiceInsightHealth -> ServiceInsightHealth -> Bool
(ServiceInsightHealth -> ServiceInsightHealth -> Bool)
-> (ServiceInsightHealth -> ServiceInsightHealth -> Bool)
-> Eq ServiceInsightHealth
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ServiceInsightHealth -> ServiceInsightHealth -> Bool
$c/= :: ServiceInsightHealth -> ServiceInsightHealth -> Bool
== :: ServiceInsightHealth -> ServiceInsightHealth -> Bool
$c== :: ServiceInsightHealth -> ServiceInsightHealth -> Bool
Prelude.Eq, ReadPrec [ServiceInsightHealth]
ReadPrec ServiceInsightHealth
Int -> ReadS ServiceInsightHealth
ReadS [ServiceInsightHealth]
(Int -> ReadS ServiceInsightHealth)
-> ReadS [ServiceInsightHealth]
-> ReadPrec ServiceInsightHealth
-> ReadPrec [ServiceInsightHealth]
-> Read ServiceInsightHealth
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ServiceInsightHealth]
$creadListPrec :: ReadPrec [ServiceInsightHealth]
readPrec :: ReadPrec ServiceInsightHealth
$creadPrec :: ReadPrec ServiceInsightHealth
readList :: ReadS [ServiceInsightHealth]
$creadList :: ReadS [ServiceInsightHealth]
readsPrec :: Int -> ReadS ServiceInsightHealth
$creadsPrec :: Int -> ReadS ServiceInsightHealth
Prelude.Read, Int -> ServiceInsightHealth -> ShowS
[ServiceInsightHealth] -> ShowS
ServiceInsightHealth -> String
(Int -> ServiceInsightHealth -> ShowS)
-> (ServiceInsightHealth -> String)
-> ([ServiceInsightHealth] -> ShowS)
-> Show ServiceInsightHealth
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ServiceInsightHealth] -> ShowS
$cshowList :: [ServiceInsightHealth] -> ShowS
show :: ServiceInsightHealth -> String
$cshow :: ServiceInsightHealth -> String
showsPrec :: Int -> ServiceInsightHealth -> ShowS
$cshowsPrec :: Int -> ServiceInsightHealth -> ShowS
Prelude.Show, (forall x. ServiceInsightHealth -> Rep ServiceInsightHealth x)
-> (forall x. Rep ServiceInsightHealth x -> ServiceInsightHealth)
-> Generic ServiceInsightHealth
forall x. Rep ServiceInsightHealth x -> ServiceInsightHealth
forall x. ServiceInsightHealth -> Rep ServiceInsightHealth x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ServiceInsightHealth x -> ServiceInsightHealth
$cfrom :: forall x. ServiceInsightHealth -> Rep ServiceInsightHealth x
Prelude.Generic)

-- |
-- Create a value of 'ServiceInsightHealth' 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:
--
-- 'openReactiveInsights', 'serviceInsightHealth_openReactiveInsights' - The number of open reactive insights in the AWS service
--
-- 'openProactiveInsights', 'serviceInsightHealth_openProactiveInsights' - The number of open proactive insights in the AWS service
newServiceInsightHealth ::
  ServiceInsightHealth
newServiceInsightHealth :: ServiceInsightHealth
newServiceInsightHealth =
  ServiceInsightHealth' :: Maybe Int -> Maybe Int -> ServiceInsightHealth
ServiceInsightHealth'
    { $sel:openReactiveInsights:ServiceInsightHealth' :: Maybe Int
openReactiveInsights =
        Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:openProactiveInsights:ServiceInsightHealth' :: Maybe Int
openProactiveInsights = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The number of open reactive insights in the AWS service
serviceInsightHealth_openReactiveInsights :: Lens.Lens' ServiceInsightHealth (Prelude.Maybe Prelude.Int)
serviceInsightHealth_openReactiveInsights :: (Maybe Int -> f (Maybe Int))
-> ServiceInsightHealth -> f ServiceInsightHealth
serviceInsightHealth_openReactiveInsights = (ServiceInsightHealth -> Maybe Int)
-> (ServiceInsightHealth -> Maybe Int -> ServiceInsightHealth)
-> Lens
     ServiceInsightHealth ServiceInsightHealth (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInsightHealth' {Maybe Int
openReactiveInsights :: Maybe Int
$sel:openReactiveInsights:ServiceInsightHealth' :: ServiceInsightHealth -> Maybe Int
openReactiveInsights} -> Maybe Int
openReactiveInsights) (\s :: ServiceInsightHealth
s@ServiceInsightHealth' {} Maybe Int
a -> ServiceInsightHealth
s {$sel:openReactiveInsights:ServiceInsightHealth' :: Maybe Int
openReactiveInsights = Maybe Int
a} :: ServiceInsightHealth)

-- | The number of open proactive insights in the AWS service
serviceInsightHealth_openProactiveInsights :: Lens.Lens' ServiceInsightHealth (Prelude.Maybe Prelude.Int)
serviceInsightHealth_openProactiveInsights :: (Maybe Int -> f (Maybe Int))
-> ServiceInsightHealth -> f ServiceInsightHealth
serviceInsightHealth_openProactiveInsights = (ServiceInsightHealth -> Maybe Int)
-> (ServiceInsightHealth -> Maybe Int -> ServiceInsightHealth)
-> Lens
     ServiceInsightHealth ServiceInsightHealth (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ServiceInsightHealth' {Maybe Int
openProactiveInsights :: Maybe Int
$sel:openProactiveInsights:ServiceInsightHealth' :: ServiceInsightHealth -> Maybe Int
openProactiveInsights} -> Maybe Int
openProactiveInsights) (\s :: ServiceInsightHealth
s@ServiceInsightHealth' {} Maybe Int
a -> ServiceInsightHealth
s {$sel:openProactiveInsights:ServiceInsightHealth' :: Maybe Int
openProactiveInsights = Maybe Int
a} :: ServiceInsightHealth)

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

instance Prelude.Hashable ServiceInsightHealth

instance Prelude.NFData ServiceInsightHealth