{-# 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.AutoScaling.Types.MetricCollectionType
-- 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.AutoScaling.Types.MetricCollectionType 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 metric.
--
-- /See:/ 'newMetricCollectionType' smart constructor.
data MetricCollectionType = MetricCollectionType'
  { -- | One of the following metrics:
    --
    -- -   @GroupMinSize@
    --
    -- -   @GroupMaxSize@
    --
    -- -   @GroupDesiredCapacity@
    --
    -- -   @GroupInServiceInstances@
    --
    -- -   @GroupPendingInstances@
    --
    -- -   @GroupStandbyInstances@
    --
    -- -   @GroupTerminatingInstances@
    --
    -- -   @GroupTotalInstances@
    --
    -- -   @GroupInServiceCapacity@
    --
    -- -   @GroupPendingCapacity@
    --
    -- -   @GroupStandbyCapacity@
    --
    -- -   @GroupTerminatingCapacity@
    --
    -- -   @GroupTotalCapacity@
    --
    -- -   @WarmPoolDesiredCapacity@
    --
    -- -   @WarmPoolWarmedCapacity@
    --
    -- -   @WarmPoolPendingCapacity@
    --
    -- -   @WarmPoolTerminatingCapacity@
    --
    -- -   @WarmPoolTotalCapacity@
    --
    -- -   @GroupAndWarmPoolDesiredCapacity@
    --
    -- -   @GroupAndWarmPoolTotalCapacity@
    MetricCollectionType -> Maybe Text
metric :: Prelude.Maybe Prelude.Text
  }
  deriving (MetricCollectionType -> MetricCollectionType -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MetricCollectionType -> MetricCollectionType -> Bool
$c/= :: MetricCollectionType -> MetricCollectionType -> Bool
== :: MetricCollectionType -> MetricCollectionType -> Bool
$c== :: MetricCollectionType -> MetricCollectionType -> Bool
Prelude.Eq, ReadPrec [MetricCollectionType]
ReadPrec MetricCollectionType
Int -> ReadS MetricCollectionType
ReadS [MetricCollectionType]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MetricCollectionType]
$creadListPrec :: ReadPrec [MetricCollectionType]
readPrec :: ReadPrec MetricCollectionType
$creadPrec :: ReadPrec MetricCollectionType
readList :: ReadS [MetricCollectionType]
$creadList :: ReadS [MetricCollectionType]
readsPrec :: Int -> ReadS MetricCollectionType
$creadsPrec :: Int -> ReadS MetricCollectionType
Prelude.Read, Int -> MetricCollectionType -> ShowS
[MetricCollectionType] -> ShowS
MetricCollectionType -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MetricCollectionType] -> ShowS
$cshowList :: [MetricCollectionType] -> ShowS
show :: MetricCollectionType -> String
$cshow :: MetricCollectionType -> String
showsPrec :: Int -> MetricCollectionType -> ShowS
$cshowsPrec :: Int -> MetricCollectionType -> ShowS
Prelude.Show, forall x. Rep MetricCollectionType x -> MetricCollectionType
forall x. MetricCollectionType -> Rep MetricCollectionType x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MetricCollectionType x -> MetricCollectionType
$cfrom :: forall x. MetricCollectionType -> Rep MetricCollectionType x
Prelude.Generic)

-- |
-- Create a value of 'MetricCollectionType' 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:
--
-- 'metric', 'metricCollectionType_metric' - One of the following metrics:
--
-- -   @GroupMinSize@
--
-- -   @GroupMaxSize@
--
-- -   @GroupDesiredCapacity@
--
-- -   @GroupInServiceInstances@
--
-- -   @GroupPendingInstances@
--
-- -   @GroupStandbyInstances@
--
-- -   @GroupTerminatingInstances@
--
-- -   @GroupTotalInstances@
--
-- -   @GroupInServiceCapacity@
--
-- -   @GroupPendingCapacity@
--
-- -   @GroupStandbyCapacity@
--
-- -   @GroupTerminatingCapacity@
--
-- -   @GroupTotalCapacity@
--
-- -   @WarmPoolDesiredCapacity@
--
-- -   @WarmPoolWarmedCapacity@
--
-- -   @WarmPoolPendingCapacity@
--
-- -   @WarmPoolTerminatingCapacity@
--
-- -   @WarmPoolTotalCapacity@
--
-- -   @GroupAndWarmPoolDesiredCapacity@
--
-- -   @GroupAndWarmPoolTotalCapacity@
newMetricCollectionType ::
  MetricCollectionType
newMetricCollectionType :: MetricCollectionType
newMetricCollectionType =
  MetricCollectionType' {$sel:metric:MetricCollectionType' :: Maybe Text
metric = forall a. Maybe a
Prelude.Nothing}

-- | One of the following metrics:
--
-- -   @GroupMinSize@
--
-- -   @GroupMaxSize@
--
-- -   @GroupDesiredCapacity@
--
-- -   @GroupInServiceInstances@
--
-- -   @GroupPendingInstances@
--
-- -   @GroupStandbyInstances@
--
-- -   @GroupTerminatingInstances@
--
-- -   @GroupTotalInstances@
--
-- -   @GroupInServiceCapacity@
--
-- -   @GroupPendingCapacity@
--
-- -   @GroupStandbyCapacity@
--
-- -   @GroupTerminatingCapacity@
--
-- -   @GroupTotalCapacity@
--
-- -   @WarmPoolDesiredCapacity@
--
-- -   @WarmPoolWarmedCapacity@
--
-- -   @WarmPoolPendingCapacity@
--
-- -   @WarmPoolTerminatingCapacity@
--
-- -   @WarmPoolTotalCapacity@
--
-- -   @GroupAndWarmPoolDesiredCapacity@
--
-- -   @GroupAndWarmPoolTotalCapacity@
metricCollectionType_metric :: Lens.Lens' MetricCollectionType (Prelude.Maybe Prelude.Text)
metricCollectionType_metric :: Lens' MetricCollectionType (Maybe Text)
metricCollectionType_metric = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MetricCollectionType' {Maybe Text
metric :: Maybe Text
$sel:metric:MetricCollectionType' :: MetricCollectionType -> Maybe Text
metric} -> Maybe Text
metric) (\s :: MetricCollectionType
s@MetricCollectionType' {} Maybe Text
a -> MetricCollectionType
s {$sel:metric:MetricCollectionType' :: Maybe Text
metric = Maybe Text
a} :: MetricCollectionType)

instance Data.FromXML MetricCollectionType where
  parseXML :: [Node] -> Either String MetricCollectionType
parseXML [Node]
x =
    Maybe Text -> MetricCollectionType
MetricCollectionType'
      forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Data..@? Text
"Metric")

instance Prelude.Hashable MetricCollectionType where
  hashWithSalt :: Int -> MetricCollectionType -> Int
hashWithSalt Int
_salt MetricCollectionType' {Maybe Text
metric :: Maybe Text
$sel:metric:MetricCollectionType' :: MetricCollectionType -> Maybe Text
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metric

instance Prelude.NFData MetricCollectionType where
  rnf :: MetricCollectionType -> ()
rnf MetricCollectionType' {Maybe Text
metric :: Maybe Text
$sel:metric:MetricCollectionType' :: MetricCollectionType -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metric