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

-- | The number of managed nodes 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 @Critical@. Critical severity is determined by the organization
    -- that published the compliance items.
    SeveritySummary -> Maybe Int
criticalCount :: 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 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 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 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 unspecified. Unspecified severity is determined by the
    -- organization that published the compliance items.
    SeveritySummary -> Maybe Int
unspecifiedCount :: Prelude.Maybe Prelude.Int
  }
  deriving (SeveritySummary -> SeveritySummary -> Bool
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]
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
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. 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:
--
-- '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.
--
-- '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.
--
-- '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.
--
-- '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.
--
-- '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.
--
-- '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.
newSeveritySummary ::
  SeveritySummary
newSeveritySummary :: SeveritySummary
newSeveritySummary =
  SeveritySummary'
    { $sel:criticalCount:SeveritySummary' :: Maybe Int
criticalCount = forall a. Maybe a
Prelude.Nothing,
      $sel:highCount:SeveritySummary' :: Maybe Int
highCount = forall a. Maybe a
Prelude.Nothing,
      $sel:informationalCount:SeveritySummary' :: Maybe Int
informationalCount = forall a. Maybe a
Prelude.Nothing,
      $sel:lowCount:SeveritySummary' :: Maybe Int
lowCount = forall a. Maybe a
Prelude.Nothing,
      $sel:mediumCount:SeveritySummary' :: Maybe Int
mediumCount = forall a. Maybe a
Prelude.Nothing,
      $sel:unspecifiedCount:SeveritySummary' :: Maybe Int
unspecifiedCount = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' SeveritySummary (Maybe Int)
severitySummary_criticalCount = 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)

-- | 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 :: Lens' SeveritySummary (Maybe Int)
severitySummary_highCount = 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 informational. Informational severity is determined by the
-- organization that published the compliance items.
severitySummary_informationalCount :: Lens.Lens' SeveritySummary (Prelude.Maybe Prelude.Int)
severitySummary_informationalCount :: Lens' SeveritySummary (Maybe Int)
severitySummary_informationalCount = 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 low. Low severity is determined by the organization that
-- published the compliance items.
severitySummary_lowCount :: Lens.Lens' SeveritySummary (Prelude.Maybe Prelude.Int)
severitySummary_lowCount :: Lens' SeveritySummary (Maybe Int)
severitySummary_lowCount = 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 medium. Medium severity is determined by the organization that
-- published the compliance items.
severitySummary_mediumCount :: Lens.Lens' SeveritySummary (Prelude.Maybe Prelude.Int)
severitySummary_mediumCount :: Lens' SeveritySummary (Maybe Int)
severitySummary_mediumCount = 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 unspecified. Unspecified severity is determined by the
-- organization that published the compliance items.
severitySummary_unspecifiedCount :: Lens.Lens' SeveritySummary (Prelude.Maybe Prelude.Int)
severitySummary_unspecifiedCount :: Lens' SeveritySummary (Maybe Int)
severitySummary_unspecifiedCount = 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)

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

instance Prelude.Hashable SeveritySummary where
  hashWithSalt :: Int -> SeveritySummary -> Int
hashWithSalt Int
_salt SeveritySummary' {Maybe Int
unspecifiedCount :: Maybe Int
mediumCount :: Maybe Int
lowCount :: Maybe Int
informationalCount :: Maybe Int
highCount :: Maybe Int
criticalCount :: Maybe Int
$sel:unspecifiedCount:SeveritySummary' :: SeveritySummary -> Maybe Int
$sel:mediumCount:SeveritySummary' :: SeveritySummary -> Maybe Int
$sel:lowCount:SeveritySummary' :: SeveritySummary -> Maybe Int
$sel:informationalCount:SeveritySummary' :: SeveritySummary -> Maybe Int
$sel:highCount:SeveritySummary' :: SeveritySummary -> Maybe Int
$sel:criticalCount:SeveritySummary' :: SeveritySummary -> Maybe Int
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
criticalCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
highCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
informationalCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
lowCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
mediumCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
unspecifiedCount

instance Prelude.NFData SeveritySummary where
  rnf :: SeveritySummary -> ()
rnf SeveritySummary' {Maybe Int
unspecifiedCount :: Maybe Int
mediumCount :: Maybe Int
lowCount :: Maybe Int
informationalCount :: Maybe Int
highCount :: Maybe Int
criticalCount :: Maybe Int
$sel:unspecifiedCount:SeveritySummary' :: SeveritySummary -> Maybe Int
$sel:mediumCount:SeveritySummary' :: SeveritySummary -> Maybe Int
$sel:lowCount:SeveritySummary' :: SeveritySummary -> Maybe Int
$sel:informationalCount:SeveritySummary' :: SeveritySummary -> Maybe Int
$sel:highCount:SeveritySummary' :: SeveritySummary -> Maybe Int
$sel:criticalCount:SeveritySummary' :: SeveritySummary -> Maybe Int
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
criticalCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
highCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
informationalCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
lowCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
mediumCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
unspecifiedCount