{-# 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.ComputeOptimizer.Types.CurrentPerformanceRiskRatings
-- 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.ComputeOptimizer.Types.CurrentPerformanceRiskRatings 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

-- | Describes the performance risk ratings for a given resource type.
--
-- Resources with a @high@ or @medium@ rating are at risk of not meeting
-- the performance needs of their workloads, while resources with a @low@
-- rating are performing well in their workloads.
--
-- /See:/ 'newCurrentPerformanceRiskRatings' smart constructor.
data CurrentPerformanceRiskRatings = CurrentPerformanceRiskRatings'
  { -- | A count of the applicable resource types with a high performance risk
    -- rating.
    CurrentPerformanceRiskRatings -> Maybe Integer
high :: Prelude.Maybe Prelude.Integer,
    -- | A count of the applicable resource types with a low performance risk
    -- rating.
    CurrentPerformanceRiskRatings -> Maybe Integer
low :: Prelude.Maybe Prelude.Integer,
    -- | A count of the applicable resource types with a medium performance risk
    -- rating.
    CurrentPerformanceRiskRatings -> Maybe Integer
medium :: Prelude.Maybe Prelude.Integer,
    -- | A count of the applicable resource types with a very low performance
    -- risk rating.
    CurrentPerformanceRiskRatings -> Maybe Integer
veryLow :: Prelude.Maybe Prelude.Integer
  }
  deriving (CurrentPerformanceRiskRatings
-> CurrentPerformanceRiskRatings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: CurrentPerformanceRiskRatings
-> CurrentPerformanceRiskRatings -> Bool
$c/= :: CurrentPerformanceRiskRatings
-> CurrentPerformanceRiskRatings -> Bool
== :: CurrentPerformanceRiskRatings
-> CurrentPerformanceRiskRatings -> Bool
$c== :: CurrentPerformanceRiskRatings
-> CurrentPerformanceRiskRatings -> Bool
Prelude.Eq, ReadPrec [CurrentPerformanceRiskRatings]
ReadPrec CurrentPerformanceRiskRatings
Int -> ReadS CurrentPerformanceRiskRatings
ReadS [CurrentPerformanceRiskRatings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [CurrentPerformanceRiskRatings]
$creadListPrec :: ReadPrec [CurrentPerformanceRiskRatings]
readPrec :: ReadPrec CurrentPerformanceRiskRatings
$creadPrec :: ReadPrec CurrentPerformanceRiskRatings
readList :: ReadS [CurrentPerformanceRiskRatings]
$creadList :: ReadS [CurrentPerformanceRiskRatings]
readsPrec :: Int -> ReadS CurrentPerformanceRiskRatings
$creadsPrec :: Int -> ReadS CurrentPerformanceRiskRatings
Prelude.Read, Int -> CurrentPerformanceRiskRatings -> ShowS
[CurrentPerformanceRiskRatings] -> ShowS
CurrentPerformanceRiskRatings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [CurrentPerformanceRiskRatings] -> ShowS
$cshowList :: [CurrentPerformanceRiskRatings] -> ShowS
show :: CurrentPerformanceRiskRatings -> String
$cshow :: CurrentPerformanceRiskRatings -> String
showsPrec :: Int -> CurrentPerformanceRiskRatings -> ShowS
$cshowsPrec :: Int -> CurrentPerformanceRiskRatings -> ShowS
Prelude.Show, forall x.
Rep CurrentPerformanceRiskRatings x
-> CurrentPerformanceRiskRatings
forall x.
CurrentPerformanceRiskRatings
-> Rep CurrentPerformanceRiskRatings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep CurrentPerformanceRiskRatings x
-> CurrentPerformanceRiskRatings
$cfrom :: forall x.
CurrentPerformanceRiskRatings
-> Rep CurrentPerformanceRiskRatings x
Prelude.Generic)

-- |
-- Create a value of 'CurrentPerformanceRiskRatings' 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:
--
-- 'high', 'currentPerformanceRiskRatings_high' - A count of the applicable resource types with a high performance risk
-- rating.
--
-- 'low', 'currentPerformanceRiskRatings_low' - A count of the applicable resource types with a low performance risk
-- rating.
--
-- 'medium', 'currentPerformanceRiskRatings_medium' - A count of the applicable resource types with a medium performance risk
-- rating.
--
-- 'veryLow', 'currentPerformanceRiskRatings_veryLow' - A count of the applicable resource types with a very low performance
-- risk rating.
newCurrentPerformanceRiskRatings ::
  CurrentPerformanceRiskRatings
newCurrentPerformanceRiskRatings :: CurrentPerformanceRiskRatings
newCurrentPerformanceRiskRatings =
  CurrentPerformanceRiskRatings'
    { $sel:high:CurrentPerformanceRiskRatings' :: Maybe Integer
high =
        forall a. Maybe a
Prelude.Nothing,
      $sel:low:CurrentPerformanceRiskRatings' :: Maybe Integer
low = forall a. Maybe a
Prelude.Nothing,
      $sel:medium:CurrentPerformanceRiskRatings' :: Maybe Integer
medium = forall a. Maybe a
Prelude.Nothing,
      $sel:veryLow:CurrentPerformanceRiskRatings' :: Maybe Integer
veryLow = forall a. Maybe a
Prelude.Nothing
    }

-- | A count of the applicable resource types with a high performance risk
-- rating.
currentPerformanceRiskRatings_high :: Lens.Lens' CurrentPerformanceRiskRatings (Prelude.Maybe Prelude.Integer)
currentPerformanceRiskRatings_high :: Lens' CurrentPerformanceRiskRatings (Maybe Integer)
currentPerformanceRiskRatings_high = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentPerformanceRiskRatings' {Maybe Integer
high :: Maybe Integer
$sel:high:CurrentPerformanceRiskRatings' :: CurrentPerformanceRiskRatings -> Maybe Integer
high} -> Maybe Integer
high) (\s :: CurrentPerformanceRiskRatings
s@CurrentPerformanceRiskRatings' {} Maybe Integer
a -> CurrentPerformanceRiskRatings
s {$sel:high:CurrentPerformanceRiskRatings' :: Maybe Integer
high = Maybe Integer
a} :: CurrentPerformanceRiskRatings)

-- | A count of the applicable resource types with a low performance risk
-- rating.
currentPerformanceRiskRatings_low :: Lens.Lens' CurrentPerformanceRiskRatings (Prelude.Maybe Prelude.Integer)
currentPerformanceRiskRatings_low :: Lens' CurrentPerformanceRiskRatings (Maybe Integer)
currentPerformanceRiskRatings_low = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentPerformanceRiskRatings' {Maybe Integer
low :: Maybe Integer
$sel:low:CurrentPerformanceRiskRatings' :: CurrentPerformanceRiskRatings -> Maybe Integer
low} -> Maybe Integer
low) (\s :: CurrentPerformanceRiskRatings
s@CurrentPerformanceRiskRatings' {} Maybe Integer
a -> CurrentPerformanceRiskRatings
s {$sel:low:CurrentPerformanceRiskRatings' :: Maybe Integer
low = Maybe Integer
a} :: CurrentPerformanceRiskRatings)

-- | A count of the applicable resource types with a medium performance risk
-- rating.
currentPerformanceRiskRatings_medium :: Lens.Lens' CurrentPerformanceRiskRatings (Prelude.Maybe Prelude.Integer)
currentPerformanceRiskRatings_medium :: Lens' CurrentPerformanceRiskRatings (Maybe Integer)
currentPerformanceRiskRatings_medium = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentPerformanceRiskRatings' {Maybe Integer
medium :: Maybe Integer
$sel:medium:CurrentPerformanceRiskRatings' :: CurrentPerformanceRiskRatings -> Maybe Integer
medium} -> Maybe Integer
medium) (\s :: CurrentPerformanceRiskRatings
s@CurrentPerformanceRiskRatings' {} Maybe Integer
a -> CurrentPerformanceRiskRatings
s {$sel:medium:CurrentPerformanceRiskRatings' :: Maybe Integer
medium = Maybe Integer
a} :: CurrentPerformanceRiskRatings)

-- | A count of the applicable resource types with a very low performance
-- risk rating.
currentPerformanceRiskRatings_veryLow :: Lens.Lens' CurrentPerformanceRiskRatings (Prelude.Maybe Prelude.Integer)
currentPerformanceRiskRatings_veryLow :: Lens' CurrentPerformanceRiskRatings (Maybe Integer)
currentPerformanceRiskRatings_veryLow = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\CurrentPerformanceRiskRatings' {Maybe Integer
veryLow :: Maybe Integer
$sel:veryLow:CurrentPerformanceRiskRatings' :: CurrentPerformanceRiskRatings -> Maybe Integer
veryLow} -> Maybe Integer
veryLow) (\s :: CurrentPerformanceRiskRatings
s@CurrentPerformanceRiskRatings' {} Maybe Integer
a -> CurrentPerformanceRiskRatings
s {$sel:veryLow:CurrentPerformanceRiskRatings' :: Maybe Integer
veryLow = Maybe Integer
a} :: CurrentPerformanceRiskRatings)

instance Data.FromJSON CurrentPerformanceRiskRatings where
  parseJSON :: Value -> Parser CurrentPerformanceRiskRatings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"CurrentPerformanceRiskRatings"
      ( \Object
x ->
          Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> Maybe Integer
-> CurrentPerformanceRiskRatings
CurrentPerformanceRiskRatings'
            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
"high")
            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
"low")
            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
"medium")
            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
"veryLow")
      )

instance
  Prelude.Hashable
    CurrentPerformanceRiskRatings
  where
  hashWithSalt :: Int -> CurrentPerformanceRiskRatings -> Int
hashWithSalt Int
_salt CurrentPerformanceRiskRatings' {Maybe Integer
veryLow :: Maybe Integer
medium :: Maybe Integer
low :: Maybe Integer
high :: Maybe Integer
$sel:veryLow:CurrentPerformanceRiskRatings' :: CurrentPerformanceRiskRatings -> Maybe Integer
$sel:medium:CurrentPerformanceRiskRatings' :: CurrentPerformanceRiskRatings -> Maybe Integer
$sel:low:CurrentPerformanceRiskRatings' :: CurrentPerformanceRiskRatings -> Maybe Integer
$sel:high:CurrentPerformanceRiskRatings' :: CurrentPerformanceRiskRatings -> Maybe Integer
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
high
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
low
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
medium
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Integer
veryLow

instance Prelude.NFData CurrentPerformanceRiskRatings where
  rnf :: CurrentPerformanceRiskRatings -> ()
rnf CurrentPerformanceRiskRatings' {Maybe Integer
veryLow :: Maybe Integer
medium :: Maybe Integer
low :: Maybe Integer
high :: Maybe Integer
$sel:veryLow:CurrentPerformanceRiskRatings' :: CurrentPerformanceRiskRatings -> Maybe Integer
$sel:medium:CurrentPerformanceRiskRatings' :: CurrentPerformanceRiskRatings -> Maybe Integer
$sel:low:CurrentPerformanceRiskRatings' :: CurrentPerformanceRiskRatings -> Maybe Integer
$sel:high:CurrentPerformanceRiskRatings' :: CurrentPerformanceRiskRatings -> Maybe Integer
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
high
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
low
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
medium
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Integer
veryLow