{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.DevOpsGuru.Types.ServiceInsightHealth where

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

-- | Contains the number of open proactive and reactive insights in an
-- analyzed Amazon Web Services service.
--
-- /See:/ 'newServiceInsightHealth' smart constructor.
data ServiceInsightHealth = ServiceInsightHealth'
  { -- | The number of open proactive insights in the Amazon Web Services service
    ServiceInsightHealth -> Maybe Int
openProactiveInsights :: Prelude.Maybe Prelude.Int,
    -- | The number of open reactive insights in the Amazon Web Services service
    ServiceInsightHealth -> Maybe Int
openReactiveInsights :: Prelude.Maybe Prelude.Int
  }
  deriving (ServiceInsightHealth -> ServiceInsightHealth -> Bool
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]
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
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. 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:
--
-- 'openProactiveInsights', 'serviceInsightHealth_openProactiveInsights' - The number of open proactive insights in the Amazon Web Services service
--
-- 'openReactiveInsights', 'serviceInsightHealth_openReactiveInsights' - The number of open reactive insights in the Amazon Web Services service
newServiceInsightHealth ::
  ServiceInsightHealth
newServiceInsightHealth :: ServiceInsightHealth
newServiceInsightHealth =
  ServiceInsightHealth'
    { $sel:openProactiveInsights:ServiceInsightHealth' :: Maybe Int
openProactiveInsights =
        forall a. Maybe a
Prelude.Nothing,
      $sel:openReactiveInsights:ServiceInsightHealth' :: Maybe Int
openReactiveInsights = forall a. Maybe a
Prelude.Nothing
    }

-- | The number of open proactive insights in the Amazon Web Services service
serviceInsightHealth_openProactiveInsights :: Lens.Lens' ServiceInsightHealth (Prelude.Maybe Prelude.Int)
serviceInsightHealth_openProactiveInsights :: Lens' ServiceInsightHealth (Maybe Int)
serviceInsightHealth_openProactiveInsights = 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)

-- | The number of open reactive insights in the Amazon Web Services service
serviceInsightHealth_openReactiveInsights :: Lens.Lens' ServiceInsightHealth (Prelude.Maybe Prelude.Int)
serviceInsightHealth_openReactiveInsights :: Lens' ServiceInsightHealth (Maybe Int)
serviceInsightHealth_openReactiveInsights = 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)

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

instance Prelude.Hashable ServiceInsightHealth where
  hashWithSalt :: Int -> ServiceInsightHealth -> Int
hashWithSalt Int
_salt ServiceInsightHealth' {Maybe Int
openReactiveInsights :: Maybe Int
openProactiveInsights :: Maybe Int
$sel:openReactiveInsights:ServiceInsightHealth' :: ServiceInsightHealth -> Maybe Int
$sel:openProactiveInsights:ServiceInsightHealth' :: ServiceInsightHealth -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
openProactiveInsights
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
openReactiveInsights

instance Prelude.NFData ServiceInsightHealth where
  rnf :: ServiceInsightHealth -> ()
rnf ServiceInsightHealth' {Maybe Int
openReactiveInsights :: Maybe Int
openProactiveInsights :: Maybe Int
$sel:openReactiveInsights:ServiceInsightHealth' :: ServiceInsightHealth -> Maybe Int
$sel:openProactiveInsights:ServiceInsightHealth' :: ServiceInsightHealth -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
openProactiveInsights
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
openReactiveInsights