{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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. 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'
{ $sel:granularity:EnabledMetric' :: Maybe Text
granularity = forall a. Maybe a
Prelude.Nothing,
$sel:metric:EnabledMetric' :: Maybe Text
metric = forall a. Maybe a
Prelude.Nothing
}
enabledMetric_granularity :: Lens.Lens' EnabledMetric (Prelude.Maybe Prelude.Text)
enabledMetric_granularity :: Lens' EnabledMetric (Maybe Text)
enabledMetric_granularity = 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 :: Lens' EnabledMetric (Maybe Text)
enabledMetric_metric = 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 Data.FromXML EnabledMetric where
parseXML :: [Node] -> Either String EnabledMetric
parseXML [Node]
x =
Maybe Text -> Maybe Text -> EnabledMetric
EnabledMetric'
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
"Granularity")
forall (f :: * -> *) a b. Applicative f => 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 EnabledMetric where
hashWithSalt :: Int -> EnabledMetric -> Int
hashWithSalt Int
_salt EnabledMetric' {Maybe Text
metric :: Maybe Text
granularity :: Maybe Text
$sel:metric:EnabledMetric' :: EnabledMetric -> Maybe Text
$sel:granularity:EnabledMetric' :: EnabledMetric -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
granularity
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
metric
instance Prelude.NFData EnabledMetric where
rnf :: EnabledMetric -> ()
rnf EnabledMetric' {Maybe Text
metric :: Maybe Text
granularity :: Maybe Text
$sel:metric:EnabledMetric' :: EnabledMetric -> Maybe Text
$sel:granularity:EnabledMetric' :: EnabledMetric -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
granularity
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
metric