{-# 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.EnabledMetric where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EnabledMetric = EnabledMetric'
{
EnabledMetric -> Maybe Text
granularity :: Prelude.Maybe Prelude.Text,
EnabledMetric -> Maybe Text
metric :: Prelude.Maybe Prelude.Text
}
deriving (EnabledMetric -> EnabledMetric -> Bool
(EnabledMetric -> EnabledMetric -> Bool)
-> (EnabledMetric -> EnabledMetric -> Bool) -> Eq EnabledMetric
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EnabledMetric -> EnabledMetric -> Bool
$c/= :: EnabledMetric -> EnabledMetric -> Bool
== :: EnabledMetric -> EnabledMetric -> Bool
$c== :: EnabledMetric -> EnabledMetric -> Bool
Prelude.Eq, ReadPrec [EnabledMetric]
ReadPrec EnabledMetric
Int -> ReadS EnabledMetric
ReadS [EnabledMetric]
(Int -> ReadS EnabledMetric)
-> ReadS [EnabledMetric]
-> ReadPrec EnabledMetric
-> ReadPrec [EnabledMetric]
-> Read EnabledMetric
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EnabledMetric]
$creadListPrec :: ReadPrec [EnabledMetric]
readPrec :: ReadPrec EnabledMetric
$creadPrec :: ReadPrec EnabledMetric
readList :: ReadS [EnabledMetric]
$creadList :: ReadS [EnabledMetric]
readsPrec :: Int -> ReadS EnabledMetric
$creadsPrec :: Int -> ReadS EnabledMetric
Prelude.Read, Int -> EnabledMetric -> ShowS
[EnabledMetric] -> ShowS
EnabledMetric -> String
(Int -> EnabledMetric -> ShowS)
-> (EnabledMetric -> String)
-> ([EnabledMetric] -> ShowS)
-> Show EnabledMetric
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EnabledMetric] -> ShowS
$cshowList :: [EnabledMetric] -> ShowS
show :: EnabledMetric -> String
$cshow :: EnabledMetric -> String
showsPrec :: Int -> EnabledMetric -> ShowS
$cshowsPrec :: Int -> EnabledMetric -> ShowS
Prelude.Show, (forall x. EnabledMetric -> Rep EnabledMetric x)
-> (forall x. Rep EnabledMetric x -> EnabledMetric)
-> Generic EnabledMetric
forall x. Rep EnabledMetric x -> EnabledMetric
forall x. EnabledMetric -> Rep EnabledMetric x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EnabledMetric x -> EnabledMetric
$cfrom :: forall x. EnabledMetric -> Rep EnabledMetric x
Prelude.Generic)
newEnabledMetric ::
EnabledMetric
newEnabledMetric :: EnabledMetric
newEnabledMetric =
EnabledMetric' :: Maybe Text -> Maybe Text -> EnabledMetric
EnabledMetric'
{ $sel:granularity:EnabledMetric' :: Maybe Text
granularity = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:metric:EnabledMetric' :: Maybe Text
metric = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
enabledMetric_granularity :: Lens.Lens' EnabledMetric (Prelude.Maybe Prelude.Text)
enabledMetric_granularity :: (Maybe Text -> f (Maybe Text)) -> EnabledMetric -> f EnabledMetric
enabledMetric_granularity = (EnabledMetric -> Maybe Text)
-> (EnabledMetric -> Maybe Text -> EnabledMetric)
-> Lens EnabledMetric EnabledMetric (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnabledMetric' {Maybe Text
granularity :: Maybe Text
$sel:granularity:EnabledMetric' :: EnabledMetric -> Maybe Text
granularity} -> Maybe Text
granularity) (\s :: EnabledMetric
s@EnabledMetric' {} Maybe Text
a -> EnabledMetric
s {$sel:granularity:EnabledMetric' :: Maybe Text
granularity = Maybe Text
a} :: EnabledMetric)
enabledMetric_metric :: Lens.Lens' EnabledMetric (Prelude.Maybe Prelude.Text)
enabledMetric_metric :: (Maybe Text -> f (Maybe Text)) -> EnabledMetric -> f EnabledMetric
enabledMetric_metric = (EnabledMetric -> Maybe Text)
-> (EnabledMetric -> Maybe Text -> EnabledMetric)
-> Lens EnabledMetric EnabledMetric (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EnabledMetric' {Maybe Text
metric :: Maybe Text
$sel:metric:EnabledMetric' :: EnabledMetric -> Maybe Text
metric} -> Maybe Text
metric) (\s :: EnabledMetric
s@EnabledMetric' {} Maybe Text
a -> EnabledMetric
s {$sel:metric:EnabledMetric' :: Maybe Text
metric = Maybe Text
a} :: EnabledMetric)
instance Core.FromXML EnabledMetric where
parseXML :: [Node] -> Either String EnabledMetric
parseXML [Node]
x =
Maybe Text -> Maybe Text -> EnabledMetric
EnabledMetric'
(Maybe Text -> Maybe Text -> EnabledMetric)
-> Either String (Maybe Text)
-> Either String (Maybe Text -> EnabledMetric)
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
"Granularity")
Either String (Maybe Text -> EnabledMetric)
-> Either String (Maybe Text) -> Either String EnabledMetric
forall (f :: * -> *) a b. Applicative f => 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 EnabledMetric
instance Prelude.NFData EnabledMetric