{-# 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 #-}
module Amazonka.AutoScaling.Types.MetricCollectionType where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data MetricCollectionType = MetricCollectionType'
{
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)
newMetricCollectionType ::
MetricCollectionType
newMetricCollectionType :: MetricCollectionType
newMetricCollectionType =
MetricCollectionType' :: Maybe Text -> MetricCollectionType
MetricCollectionType' {$sel:metric:MetricCollectionType' :: Maybe Text
metric = Maybe Text
forall a. Maybe a
Prelude.Nothing}
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