{-# 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.OpsWorks.Types.AutoScalingThresholds
-- 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.OpsWorks.Types.AutoScalingThresholds 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 a load-based auto scaling upscaling or downscaling threshold
-- configuration, which specifies when AWS OpsWorks Stacks starts or stops
-- load-based instances.
--
-- /See:/ 'newAutoScalingThresholds' smart constructor.
data AutoScalingThresholds = AutoScalingThresholds'
  { -- | Custom Cloudwatch auto scaling alarms, to be used as thresholds. This
    -- parameter takes a list of up to five alarm names, which are case
    -- sensitive and must be in the same region as the stack.
    --
    -- To use custom alarms, you must update your service role to allow
    -- @cloudwatch:DescribeAlarms@. You can either have AWS OpsWorks Stacks
    -- update the role for you when you first use this feature or you can edit
    -- the role manually. For more information, see
    -- <https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-servicerole.html Allowing AWS OpsWorks Stacks to Act on Your Behalf>.
    AutoScalingThresholds -> Maybe [Text]
alarms :: Prelude.Maybe [Prelude.Text],
    -- | The CPU utilization threshold, as a percent of the available CPU. A
    -- value of -1 disables the threshold.
    AutoScalingThresholds -> Maybe Double
cpuThreshold :: Prelude.Maybe Prelude.Double,
    -- | The amount of time (in minutes) after a scaling event occurs that AWS
    -- OpsWorks Stacks should ignore metrics and suppress additional scaling
    -- events. For example, AWS OpsWorks Stacks adds new instances following an
    -- upscaling event but the instances won\'t start reducing the load until
    -- they have been booted and configured. There is no point in raising
    -- additional scaling events during that operation, which typically takes
    -- several minutes. @IgnoreMetricsTime@ allows you to direct AWS OpsWorks
    -- Stacks to suppress scaling events long enough to get the new instances
    -- online.
    AutoScalingThresholds -> Maybe Natural
ignoreMetricsTime :: Prelude.Maybe Prelude.Natural,
    -- | The number of instances to add or remove when the load exceeds a
    -- threshold.
    AutoScalingThresholds -> Maybe Int
instanceCount :: Prelude.Maybe Prelude.Int,
    -- | The load threshold. A value of -1 disables the threshold. For more
    -- information about how load is computed, see
    -- <http://en.wikipedia.org/wiki/Load_%28computing%29 Load (computing)>.
    AutoScalingThresholds -> Maybe Double
loadThreshold :: Prelude.Maybe Prelude.Double,
    -- | The memory utilization threshold, as a percent of the available memory.
    -- A value of -1 disables the threshold.
    AutoScalingThresholds -> Maybe Double
memoryThreshold :: Prelude.Maybe Prelude.Double,
    -- | The amount of time, in minutes, that the load must exceed a threshold
    -- before more instances are added or removed.
    AutoScalingThresholds -> Maybe Natural
thresholdsWaitTime :: Prelude.Maybe Prelude.Natural
  }
  deriving (AutoScalingThresholds -> AutoScalingThresholds -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AutoScalingThresholds -> AutoScalingThresholds -> Bool
$c/= :: AutoScalingThresholds -> AutoScalingThresholds -> Bool
== :: AutoScalingThresholds -> AutoScalingThresholds -> Bool
$c== :: AutoScalingThresholds -> AutoScalingThresholds -> Bool
Prelude.Eq, ReadPrec [AutoScalingThresholds]
ReadPrec AutoScalingThresholds
Int -> ReadS AutoScalingThresholds
ReadS [AutoScalingThresholds]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AutoScalingThresholds]
$creadListPrec :: ReadPrec [AutoScalingThresholds]
readPrec :: ReadPrec AutoScalingThresholds
$creadPrec :: ReadPrec AutoScalingThresholds
readList :: ReadS [AutoScalingThresholds]
$creadList :: ReadS [AutoScalingThresholds]
readsPrec :: Int -> ReadS AutoScalingThresholds
$creadsPrec :: Int -> ReadS AutoScalingThresholds
Prelude.Read, Int -> AutoScalingThresholds -> ShowS
[AutoScalingThresholds] -> ShowS
AutoScalingThresholds -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AutoScalingThresholds] -> ShowS
$cshowList :: [AutoScalingThresholds] -> ShowS
show :: AutoScalingThresholds -> String
$cshow :: AutoScalingThresholds -> String
showsPrec :: Int -> AutoScalingThresholds -> ShowS
$cshowsPrec :: Int -> AutoScalingThresholds -> ShowS
Prelude.Show, forall x. Rep AutoScalingThresholds x -> AutoScalingThresholds
forall x. AutoScalingThresholds -> Rep AutoScalingThresholds x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AutoScalingThresholds x -> AutoScalingThresholds
$cfrom :: forall x. AutoScalingThresholds -> Rep AutoScalingThresholds x
Prelude.Generic)

-- |
-- Create a value of 'AutoScalingThresholds' 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:
--
-- 'alarms', 'autoScalingThresholds_alarms' - Custom Cloudwatch auto scaling alarms, to be used as thresholds. This
-- parameter takes a list of up to five alarm names, which are case
-- sensitive and must be in the same region as the stack.
--
-- To use custom alarms, you must update your service role to allow
-- @cloudwatch:DescribeAlarms@. You can either have AWS OpsWorks Stacks
-- update the role for you when you first use this feature or you can edit
-- the role manually. For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-servicerole.html Allowing AWS OpsWorks Stacks to Act on Your Behalf>.
--
-- 'cpuThreshold', 'autoScalingThresholds_cpuThreshold' - The CPU utilization threshold, as a percent of the available CPU. A
-- value of -1 disables the threshold.
--
-- 'ignoreMetricsTime', 'autoScalingThresholds_ignoreMetricsTime' - The amount of time (in minutes) after a scaling event occurs that AWS
-- OpsWorks Stacks should ignore metrics and suppress additional scaling
-- events. For example, AWS OpsWorks Stacks adds new instances following an
-- upscaling event but the instances won\'t start reducing the load until
-- they have been booted and configured. There is no point in raising
-- additional scaling events during that operation, which typically takes
-- several minutes. @IgnoreMetricsTime@ allows you to direct AWS OpsWorks
-- Stacks to suppress scaling events long enough to get the new instances
-- online.
--
-- 'instanceCount', 'autoScalingThresholds_instanceCount' - The number of instances to add or remove when the load exceeds a
-- threshold.
--
-- 'loadThreshold', 'autoScalingThresholds_loadThreshold' - The load threshold. A value of -1 disables the threshold. For more
-- information about how load is computed, see
-- <http://en.wikipedia.org/wiki/Load_%28computing%29 Load (computing)>.
--
-- 'memoryThreshold', 'autoScalingThresholds_memoryThreshold' - The memory utilization threshold, as a percent of the available memory.
-- A value of -1 disables the threshold.
--
-- 'thresholdsWaitTime', 'autoScalingThresholds_thresholdsWaitTime' - The amount of time, in minutes, that the load must exceed a threshold
-- before more instances are added or removed.
newAutoScalingThresholds ::
  AutoScalingThresholds
newAutoScalingThresholds :: AutoScalingThresholds
newAutoScalingThresholds =
  AutoScalingThresholds'
    { $sel:alarms:AutoScalingThresholds' :: Maybe [Text]
alarms = forall a. Maybe a
Prelude.Nothing,
      $sel:cpuThreshold:AutoScalingThresholds' :: Maybe Double
cpuThreshold = forall a. Maybe a
Prelude.Nothing,
      $sel:ignoreMetricsTime:AutoScalingThresholds' :: Maybe Natural
ignoreMetricsTime = forall a. Maybe a
Prelude.Nothing,
      $sel:instanceCount:AutoScalingThresholds' :: Maybe Int
instanceCount = forall a. Maybe a
Prelude.Nothing,
      $sel:loadThreshold:AutoScalingThresholds' :: Maybe Double
loadThreshold = forall a. Maybe a
Prelude.Nothing,
      $sel:memoryThreshold:AutoScalingThresholds' :: Maybe Double
memoryThreshold = forall a. Maybe a
Prelude.Nothing,
      $sel:thresholdsWaitTime:AutoScalingThresholds' :: Maybe Natural
thresholdsWaitTime = forall a. Maybe a
Prelude.Nothing
    }

-- | Custom Cloudwatch auto scaling alarms, to be used as thresholds. This
-- parameter takes a list of up to five alarm names, which are case
-- sensitive and must be in the same region as the stack.
--
-- To use custom alarms, you must update your service role to allow
-- @cloudwatch:DescribeAlarms@. You can either have AWS OpsWorks Stacks
-- update the role for you when you first use this feature or you can edit
-- the role manually. For more information, see
-- <https://docs.aws.amazon.com/opsworks/latest/userguide/opsworks-security-servicerole.html Allowing AWS OpsWorks Stacks to Act on Your Behalf>.
autoScalingThresholds_alarms :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe [Prelude.Text])
autoScalingThresholds_alarms :: Lens' AutoScalingThresholds (Maybe [Text])
autoScalingThresholds_alarms = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe [Text]
alarms :: Maybe [Text]
$sel:alarms:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe [Text]
alarms} -> Maybe [Text]
alarms) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe [Text]
a -> AutoScalingThresholds
s {$sel:alarms:AutoScalingThresholds' :: Maybe [Text]
alarms = Maybe [Text]
a} :: AutoScalingThresholds) forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The CPU utilization threshold, as a percent of the available CPU. A
-- value of -1 disables the threshold.
autoScalingThresholds_cpuThreshold :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Double)
autoScalingThresholds_cpuThreshold :: Lens' AutoScalingThresholds (Maybe Double)
autoScalingThresholds_cpuThreshold = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe Double
cpuThreshold :: Maybe Double
$sel:cpuThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
cpuThreshold} -> Maybe Double
cpuThreshold) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe Double
a -> AutoScalingThresholds
s {$sel:cpuThreshold:AutoScalingThresholds' :: Maybe Double
cpuThreshold = Maybe Double
a} :: AutoScalingThresholds)

-- | The amount of time (in minutes) after a scaling event occurs that AWS
-- OpsWorks Stacks should ignore metrics and suppress additional scaling
-- events. For example, AWS OpsWorks Stacks adds new instances following an
-- upscaling event but the instances won\'t start reducing the load until
-- they have been booted and configured. There is no point in raising
-- additional scaling events during that operation, which typically takes
-- several minutes. @IgnoreMetricsTime@ allows you to direct AWS OpsWorks
-- Stacks to suppress scaling events long enough to get the new instances
-- online.
autoScalingThresholds_ignoreMetricsTime :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Natural)
autoScalingThresholds_ignoreMetricsTime :: Lens' AutoScalingThresholds (Maybe Natural)
autoScalingThresholds_ignoreMetricsTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe Natural
ignoreMetricsTime :: Maybe Natural
$sel:ignoreMetricsTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
ignoreMetricsTime} -> Maybe Natural
ignoreMetricsTime) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe Natural
a -> AutoScalingThresholds
s {$sel:ignoreMetricsTime:AutoScalingThresholds' :: Maybe Natural
ignoreMetricsTime = Maybe Natural
a} :: AutoScalingThresholds)

-- | The number of instances to add or remove when the load exceeds a
-- threshold.
autoScalingThresholds_instanceCount :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Int)
autoScalingThresholds_instanceCount :: Lens' AutoScalingThresholds (Maybe Int)
autoScalingThresholds_instanceCount = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe Int
instanceCount :: Maybe Int
$sel:instanceCount:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Int
instanceCount} -> Maybe Int
instanceCount) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe Int
a -> AutoScalingThresholds
s {$sel:instanceCount:AutoScalingThresholds' :: Maybe Int
instanceCount = Maybe Int
a} :: AutoScalingThresholds)

-- | The load threshold. A value of -1 disables the threshold. For more
-- information about how load is computed, see
-- <http://en.wikipedia.org/wiki/Load_%28computing%29 Load (computing)>.
autoScalingThresholds_loadThreshold :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Double)
autoScalingThresholds_loadThreshold :: Lens' AutoScalingThresholds (Maybe Double)
autoScalingThresholds_loadThreshold = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe Double
loadThreshold :: Maybe Double
$sel:loadThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
loadThreshold} -> Maybe Double
loadThreshold) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe Double
a -> AutoScalingThresholds
s {$sel:loadThreshold:AutoScalingThresholds' :: Maybe Double
loadThreshold = Maybe Double
a} :: AutoScalingThresholds)

-- | The memory utilization threshold, as a percent of the available memory.
-- A value of -1 disables the threshold.
autoScalingThresholds_memoryThreshold :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Double)
autoScalingThresholds_memoryThreshold :: Lens' AutoScalingThresholds (Maybe Double)
autoScalingThresholds_memoryThreshold = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe Double
memoryThreshold :: Maybe Double
$sel:memoryThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
memoryThreshold} -> Maybe Double
memoryThreshold) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe Double
a -> AutoScalingThresholds
s {$sel:memoryThreshold:AutoScalingThresholds' :: Maybe Double
memoryThreshold = Maybe Double
a} :: AutoScalingThresholds)

-- | The amount of time, in minutes, that the load must exceed a threshold
-- before more instances are added or removed.
autoScalingThresholds_thresholdsWaitTime :: Lens.Lens' AutoScalingThresholds (Prelude.Maybe Prelude.Natural)
autoScalingThresholds_thresholdsWaitTime :: Lens' AutoScalingThresholds (Maybe Natural)
autoScalingThresholds_thresholdsWaitTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AutoScalingThresholds' {Maybe Natural
thresholdsWaitTime :: Maybe Natural
$sel:thresholdsWaitTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
thresholdsWaitTime} -> Maybe Natural
thresholdsWaitTime) (\s :: AutoScalingThresholds
s@AutoScalingThresholds' {} Maybe Natural
a -> AutoScalingThresholds
s {$sel:thresholdsWaitTime:AutoScalingThresholds' :: Maybe Natural
thresholdsWaitTime = Maybe Natural
a} :: AutoScalingThresholds)

instance Data.FromJSON AutoScalingThresholds where
  parseJSON :: Value -> Parser AutoScalingThresholds
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"AutoScalingThresholds"
      ( \Object
x ->
          Maybe [Text]
-> Maybe Double
-> Maybe Natural
-> Maybe Int
-> Maybe Double
-> Maybe Double
-> Maybe Natural
-> AutoScalingThresholds
AutoScalingThresholds'
            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
"Alarms" forall a. Parser (Maybe a) -> a -> Parser a
Data..!= forall a. Monoid a => a
Prelude.mempty)
            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
"CpuThreshold")
            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
"IgnoreMetricsTime")
            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
"InstanceCount")
            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
"LoadThreshold")
            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
"MemoryThreshold")
            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
"ThresholdsWaitTime")
      )

instance Prelude.Hashable AutoScalingThresholds where
  hashWithSalt :: Int -> AutoScalingThresholds -> Int
hashWithSalt Int
_salt AutoScalingThresholds' {Maybe Double
Maybe Int
Maybe Natural
Maybe [Text]
thresholdsWaitTime :: Maybe Natural
memoryThreshold :: Maybe Double
loadThreshold :: Maybe Double
instanceCount :: Maybe Int
ignoreMetricsTime :: Maybe Natural
cpuThreshold :: Maybe Double
alarms :: Maybe [Text]
$sel:thresholdsWaitTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:memoryThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:loadThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:instanceCount:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Int
$sel:ignoreMetricsTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:cpuThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:alarms:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe [Text]
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe [Text]
alarms
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
cpuThreshold
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
ignoreMetricsTime
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Int
instanceCount
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
loadThreshold
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Double
memoryThreshold
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
thresholdsWaitTime

instance Prelude.NFData AutoScalingThresholds where
  rnf :: AutoScalingThresholds -> ()
rnf AutoScalingThresholds' {Maybe Double
Maybe Int
Maybe Natural
Maybe [Text]
thresholdsWaitTime :: Maybe Natural
memoryThreshold :: Maybe Double
loadThreshold :: Maybe Double
instanceCount :: Maybe Int
ignoreMetricsTime :: Maybe Natural
cpuThreshold :: Maybe Double
alarms :: Maybe [Text]
$sel:thresholdsWaitTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:memoryThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:loadThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:instanceCount:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Int
$sel:ignoreMetricsTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:cpuThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:alarms:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe [Text]
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe [Text]
alarms
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
cpuThreshold
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
ignoreMetricsTime
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Int
instanceCount
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
loadThreshold
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Double
memoryThreshold
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
thresholdsWaitTime

instance Data.ToJSON AutoScalingThresholds where
  toJSON :: AutoScalingThresholds -> Value
toJSON AutoScalingThresholds' {Maybe Double
Maybe Int
Maybe Natural
Maybe [Text]
thresholdsWaitTime :: Maybe Natural
memoryThreshold :: Maybe Double
loadThreshold :: Maybe Double
instanceCount :: Maybe Int
ignoreMetricsTime :: Maybe Natural
cpuThreshold :: Maybe Double
alarms :: Maybe [Text]
$sel:thresholdsWaitTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:memoryThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:loadThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:instanceCount:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Int
$sel:ignoreMetricsTime:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Natural
$sel:cpuThreshold:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe Double
$sel:alarms:AutoScalingThresholds' :: AutoScalingThresholds -> Maybe [Text]
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"Alarms" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Text]
alarms,
            (Key
"CpuThreshold" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
cpuThreshold,
            (Key
"IgnoreMetricsTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
ignoreMetricsTime,
            (Key
"InstanceCount" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Int
instanceCount,
            (Key
"LoadThreshold" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
loadThreshold,
            (Key
"MemoryThreshold" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Double
memoryThreshold,
            (Key
"ThresholdsWaitTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
              forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
thresholdsWaitTime
          ]
      )