{-# 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.SSM.Types.SeveritySummary
-- 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.SSM.Types.SeveritySummary where

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

-- | The number of managed instances found for each patch severity level
-- defined in the request filter.
--
-- /See:/ 'newSeveritySummary' smart constructor.
data SeveritySummary = SeveritySummary'
  { -- | The total number of resources or compliance items that have a severity
    -- level of low. Low severity is determined by the organization that
    -- published the compliance items.
    SeveritySummary -> Maybe Int
lowCount :: Prelude.Maybe Prelude.Int,
    -- | The total number of resources or compliance items that have a severity
    -- level of unspecified. Unspecified severity is determined by the
    -- organization that published the compliance items.
    SeveritySummary -> Maybe Int
unspecifiedCount :: Prelude.Maybe Prelude.Int,
    -- | The total number of resources or compliance items that have a severity
    -- level of high. High severity is determined by the organization that
    -- published the compliance items.
    SeveritySummary -> Maybe Int
highCount :: Prelude.Maybe Prelude.Int,
    -- | The total number of resources or compliance items that have a severity
    -- level of medium. Medium severity is determined by the organization that
    -- published the compliance items.
    SeveritySummary -> Maybe Int
mediumCount :: Prelude.Maybe Prelude.Int,
    -- | The total number of resources or compliance items that have a severity
    -- level of informational. Informational severity is determined by the
    -- organization that published the compliance items.
    SeveritySummary -> Maybe Int
informationalCount :: Prelude.Maybe Prelude.Int,
    -- | The total number of resources or compliance items that have a severity
    -- level of critical. Critical severity is determined by the organization
    -- that published the compliance items.
    SeveritySummary -> Maybe Int
criticalCount :: Prelude.Maybe Prelude.Int
  }
  deriving (SeveritySummary -> SeveritySummary -> Bool
(SeveritySummary -> SeveritySummary -> Bool)
-> (SeveritySummary -> SeveritySummary -> Bool)
-> Eq SeveritySummary
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SeveritySummary -> SeveritySummary -> Bool
$c/= :: SeveritySummary -> SeveritySummary -> Bool
== :: SeveritySummary -> SeveritySummary -> Bool
$c== :: SeveritySummary -> SeveritySummary -> Bool
Prelude.Eq, ReadPrec [SeveritySummary]
ReadPrec SeveritySummary
Int -> ReadS SeveritySummary
ReadS [SeveritySummary]
(Int -> ReadS SeveritySummary)
-> ReadS [SeveritySummary]
-> ReadPrec SeveritySummary
-> ReadPrec [SeveritySummary]
-> Read SeveritySummary
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SeveritySummary]
$creadListPrec :: ReadPrec [SeveritySummary]
readPrec :: ReadPrec SeveritySummary
$creadPrec :: ReadPrec SeveritySummary
readList :: ReadS [SeveritySummary]
$creadList :: ReadS [SeveritySummary]
readsPrec :: Int -> ReadS SeveritySummary
$creadsPrec :: Int -> ReadS SeveritySummary
Prelude.Read, Int -> SeveritySummary -> ShowS
[SeveritySummary] -> ShowS
SeveritySummary -> String
(Int -> SeveritySummary -> ShowS)
-> (SeveritySummary -> String)
-> ([SeveritySummary] -> ShowS)
-> Show SeveritySummary
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SeveritySummary] -> ShowS
$cshowList :: [SeveritySummary] -> ShowS
show :: SeveritySummary -> String
$cshow :: SeveritySummary -> String
showsPrec :: Int -> SeveritySummary -> ShowS
$cshowsPrec :: Int -> SeveritySummary -> ShowS
Prelude.Show, (forall x. SeveritySummary -> Rep SeveritySummary x)
-> (forall x. Rep SeveritySummary x -> SeveritySummary)
-> Generic SeveritySummary
forall x. Rep SeveritySummary x -> SeveritySummary
forall x. SeveritySummary -> Rep SeveritySummary x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SeveritySummary x -> SeveritySummary
$cfrom :: forall x. SeveritySummary -> Rep SeveritySummary x
Prelude.Generic)

-- |
-- Create a value of 'SeveritySummary' 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:
--
-- 'lowCount', 'severitySummary_lowCount' - The total number of resources or compliance items that have a severity
-- level of low. Low severity is determined by the organization that
-- published the compliance items.
--
-- 'unspecifiedCount', 'severitySummary_unspecifiedCount' - The total number of resources or compliance items that have a severity
-- level of unspecified. Unspecified severity is determined by the
-- organization that published the compliance items.
--
-- 'highCount', 'severitySummary_highCount' - The total number of resources or compliance items that have a severity
-- level of high. High severity is determined by the organization that
-- published the compliance items.
--
-- 'mediumCount', 'severitySummary_mediumCount' - The total number of resources or compliance items that have a severity
-- level of medium. Medium severity is determined by the organization that
-- published the compliance items.
--
-- 'informationalCount', 'severitySummary_informationalCount' - The total number of resources or compliance items that have a severity
-- level of informational. Informational severity is determined by the
-- organization that published the compliance items.
--
-- 'criticalCount', 'severitySummary_criticalCount' - The total number of resources or compliance items that have a severity
-- level of critical. Critical severity is determined by the organization
-- that published the compliance items.
newSeveritySummary ::
  SeveritySummary
newSeveritySummary :: SeveritySummary
newSeveritySummary =
  SeveritySummary' :: Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> SeveritySummary
SeveritySummary'
    { $sel:lowCount:SeveritySummary' :: Maybe Int
lowCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:unspecifiedCount:SeveritySummary' :: Maybe Int
unspecifiedCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:highCount:SeveritySummary' :: Maybe Int
highCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:mediumCount:SeveritySummary' :: Maybe Int
mediumCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:informationalCount:SeveritySummary' :: Maybe Int
informationalCount = Maybe Int
forall a. Maybe a
Prelude.Nothing,
      $sel:criticalCount:SeveritySummary' :: Maybe Int
criticalCount = Maybe Int
forall a. Maybe a
Prelude.Nothing
    }

-- | The total number of resources or compliance items that have a severity
-- level of low. Low severity is determined by the organization that
-- published the compliance items.
severitySummary_lowCount :: Lens.Lens' SeveritySummary (Prelude.Maybe Prelude.Int)
severitySummary_lowCount :: (Maybe Int -> f (Maybe Int))
-> SeveritySummary -> f SeveritySummary
severitySummary_lowCount = (SeveritySummary -> Maybe Int)
-> (SeveritySummary -> Maybe Int -> SeveritySummary)
-> Lens SeveritySummary SeveritySummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SeveritySummary' {Maybe Int
lowCount :: Maybe Int
$sel:lowCount:SeveritySummary' :: SeveritySummary -> Maybe Int
lowCount} -> Maybe Int
lowCount) (\s :: SeveritySummary
s@SeveritySummary' {} Maybe Int
a -> SeveritySummary
s {$sel:lowCount:SeveritySummary' :: Maybe Int
lowCount = Maybe Int
a} :: SeveritySummary)

-- | The total number of resources or compliance items that have a severity
-- level of unspecified. Unspecified severity is determined by the
-- organization that published the compliance items.
severitySummary_unspecifiedCount :: Lens.Lens' SeveritySummary (Prelude.Maybe Prelude.Int)
severitySummary_unspecifiedCount :: (Maybe Int -> f (Maybe Int))
-> SeveritySummary -> f SeveritySummary
severitySummary_unspecifiedCount = (SeveritySummary -> Maybe Int)
-> (SeveritySummary -> Maybe Int -> SeveritySummary)
-> Lens SeveritySummary SeveritySummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SeveritySummary' {Maybe Int
unspecifiedCount :: Maybe Int
$sel:unspecifiedCount:SeveritySummary' :: SeveritySummary -> Maybe Int
unspecifiedCount} -> Maybe Int
unspecifiedCount) (\s :: SeveritySummary
s@SeveritySummary' {} Maybe Int
a -> SeveritySummary
s {$sel:unspecifiedCount:SeveritySummary' :: Maybe Int
unspecifiedCount = Maybe Int
a} :: SeveritySummary)

-- | The total number of resources or compliance items that have a severity
-- level of high. High severity is determined by the organization that
-- published the compliance items.
severitySummary_highCount :: Lens.Lens' SeveritySummary (Prelude.Maybe Prelude.Int)
severitySummary_highCount :: (Maybe Int -> f (Maybe Int))
-> SeveritySummary -> f SeveritySummary
severitySummary_highCount = (SeveritySummary -> Maybe Int)
-> (SeveritySummary -> Maybe Int -> SeveritySummary)
-> Lens SeveritySummary SeveritySummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SeveritySummary' {Maybe Int
highCount :: Maybe Int
$sel:highCount:SeveritySummary' :: SeveritySummary -> Maybe Int
highCount} -> Maybe Int
highCount) (\s :: SeveritySummary
s@SeveritySummary' {} Maybe Int
a -> SeveritySummary
s {$sel:highCount:SeveritySummary' :: Maybe Int
highCount = Maybe Int
a} :: SeveritySummary)

-- | The total number of resources or compliance items that have a severity
-- level of medium. Medium severity is determined by the organization that
-- published the compliance items.
severitySummary_mediumCount :: Lens.Lens' SeveritySummary (Prelude.Maybe Prelude.Int)
severitySummary_mediumCount :: (Maybe Int -> f (Maybe Int))
-> SeveritySummary -> f SeveritySummary
severitySummary_mediumCount = (SeveritySummary -> Maybe Int)
-> (SeveritySummary -> Maybe Int -> SeveritySummary)
-> Lens SeveritySummary SeveritySummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SeveritySummary' {Maybe Int
mediumCount :: Maybe Int
$sel:mediumCount:SeveritySummary' :: SeveritySummary -> Maybe Int
mediumCount} -> Maybe Int
mediumCount) (\s :: SeveritySummary
s@SeveritySummary' {} Maybe Int
a -> SeveritySummary
s {$sel:mediumCount:SeveritySummary' :: Maybe Int
mediumCount = Maybe Int
a} :: SeveritySummary)

-- | The total number of resources or compliance items that have a severity
-- level of informational. Informational severity is determined by the
-- organization that published the compliance items.
severitySummary_informationalCount :: Lens.Lens' SeveritySummary (Prelude.Maybe Prelude.Int)
severitySummary_informationalCount :: (Maybe Int -> f (Maybe Int))
-> SeveritySummary -> f SeveritySummary
severitySummary_informationalCount = (SeveritySummary -> Maybe Int)
-> (SeveritySummary -> Maybe Int -> SeveritySummary)
-> Lens SeveritySummary SeveritySummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SeveritySummary' {Maybe Int
informationalCount :: Maybe Int
$sel:informationalCount:SeveritySummary' :: SeveritySummary -> Maybe Int
informationalCount} -> Maybe Int
informationalCount) (\s :: SeveritySummary
s@SeveritySummary' {} Maybe Int
a -> SeveritySummary
s {$sel:informationalCount:SeveritySummary' :: Maybe Int
informationalCount = Maybe Int
a} :: SeveritySummary)

-- | The total number of resources or compliance items that have a severity
-- level of critical. Critical severity is determined by the organization
-- that published the compliance items.
severitySummary_criticalCount :: Lens.Lens' SeveritySummary (Prelude.Maybe Prelude.Int)
severitySummary_criticalCount :: (Maybe Int -> f (Maybe Int))
-> SeveritySummary -> f SeveritySummary
severitySummary_criticalCount = (SeveritySummary -> Maybe Int)
-> (SeveritySummary -> Maybe Int -> SeveritySummary)
-> Lens SeveritySummary SeveritySummary (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SeveritySummary' {Maybe Int
criticalCount :: Maybe Int
$sel:criticalCount:SeveritySummary' :: SeveritySummary -> Maybe Int
criticalCount} -> Maybe Int
criticalCount) (\s :: SeveritySummary
s@SeveritySummary' {} Maybe Int
a -> SeveritySummary
s {$sel:criticalCount:SeveritySummary' :: Maybe Int
criticalCount = Maybe Int
a} :: SeveritySummary)

instance Core.FromJSON SeveritySummary where
  parseJSON :: Value -> Parser SeveritySummary
parseJSON =
    String
-> (Object -> Parser SeveritySummary)
-> Value
-> Parser SeveritySummary
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"SeveritySummary"
      ( \Object
x ->
          Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> Maybe Int
-> SeveritySummary
SeveritySummary'
            (Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> Maybe Int
 -> SeveritySummary)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> Maybe Int
      -> SeveritySummary)
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
"LowCount")
            Parser
  (Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> Maybe Int
   -> SeveritySummary)
-> Parser (Maybe Int)
-> Parser
     (Maybe Int
      -> Maybe Int -> Maybe Int -> Maybe Int -> SeveritySummary)
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
"UnspecifiedCount")
            Parser
  (Maybe Int
   -> Maybe Int -> Maybe Int -> Maybe Int -> SeveritySummary)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Int -> Maybe Int -> SeveritySummary)
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
"HighCount")
            Parser (Maybe Int -> Maybe Int -> Maybe Int -> SeveritySummary)
-> Parser (Maybe Int)
-> Parser (Maybe Int -> Maybe Int -> SeveritySummary)
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
"MediumCount")
            Parser (Maybe Int -> Maybe Int -> SeveritySummary)
-> Parser (Maybe Int) -> Parser (Maybe Int -> SeveritySummary)
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
"InformationalCount")
            Parser (Maybe Int -> SeveritySummary)
-> Parser (Maybe Int) -> Parser SeveritySummary
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
"CriticalCount")
      )

instance Prelude.Hashable SeveritySummary

instance Prelude.NFData SeveritySummary