{-# 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-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.AutoScaling.Types.MetricCollectionType where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
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
(MetricCollectionType -> MetricCollectionType -> Bool)
-> (MetricCollectionType -> MetricCollectionType -> Bool)
-> Eq MetricCollectionType
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]
(Int -> ReadS MetricCollectionType)
-> ReadS [MetricCollectionType]
-> ReadPrec MetricCollectionType
-> ReadPrec [MetricCollectionType]
-> Read 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
(Int -> MetricCollectionType -> ShowS)
-> (MetricCollectionType -> String)
-> ([MetricCollectionType] -> ShowS)
-> Show MetricCollectionType
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. MetricCollectionType -> Rep MetricCollectionType x)
-> (forall x. Rep MetricCollectionType x -> MetricCollectionType)
-> Generic MetricCollectionType
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' :: Maybe Text -> MetricCollectionType
MetricCollectionType' {$sel:metric:MetricCollectionType' :: Maybe Text
metric = Maybe Text
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 :: (Maybe Text -> f (Maybe Text))
-> MetricCollectionType -> f MetricCollectionType
metricCollectionType_metric = (MetricCollectionType -> Maybe Text)
-> (MetricCollectionType -> Maybe Text -> MetricCollectionType)
-> Lens
     MetricCollectionType MetricCollectionType (Maybe Text) (Maybe Text)
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 Core.FromXML MetricCollectionType where
  parseXML :: [Node] -> Either String MetricCollectionType
parseXML [Node]
x =
    Maybe Text -> MetricCollectionType
MetricCollectionType'
      (Maybe Text -> MetricCollectionType)
-> Either String (Maybe Text) -> Either String MetricCollectionType
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Text)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Metric")

instance Prelude.Hashable MetricCollectionType

instance Prelude.NFData MetricCollectionType