{-# 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.PredictiveScalingMetricSpecification where
import Amazonka.AutoScaling.Types.PredictiveScalingPredefinedLoadMetric
import Amazonka.AutoScaling.Types.PredictiveScalingPredefinedMetricPair
import Amazonka.AutoScaling.Types.PredictiveScalingPredefinedScalingMetric
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PredictiveScalingMetricSpecification = PredictiveScalingMetricSpecification'
{
PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedScalingMetric
predefinedScalingMetricSpecification :: Prelude.Maybe PredictiveScalingPredefinedScalingMetric,
PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedMetricPair
predefinedMetricPairSpecification :: Prelude.Maybe PredictiveScalingPredefinedMetricPair,
PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedLoadMetric
predefinedLoadMetricSpecification :: Prelude.Maybe PredictiveScalingPredefinedLoadMetric,
PredictiveScalingMetricSpecification -> Double
targetValue :: Prelude.Double
}
deriving (PredictiveScalingMetricSpecification
-> PredictiveScalingMetricSpecification -> Bool
(PredictiveScalingMetricSpecification
-> PredictiveScalingMetricSpecification -> Bool)
-> (PredictiveScalingMetricSpecification
-> PredictiveScalingMetricSpecification -> Bool)
-> Eq PredictiveScalingMetricSpecification
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PredictiveScalingMetricSpecification
-> PredictiveScalingMetricSpecification -> Bool
$c/= :: PredictiveScalingMetricSpecification
-> PredictiveScalingMetricSpecification -> Bool
== :: PredictiveScalingMetricSpecification
-> PredictiveScalingMetricSpecification -> Bool
$c== :: PredictiveScalingMetricSpecification
-> PredictiveScalingMetricSpecification -> Bool
Prelude.Eq, ReadPrec [PredictiveScalingMetricSpecification]
ReadPrec PredictiveScalingMetricSpecification
Int -> ReadS PredictiveScalingMetricSpecification
ReadS [PredictiveScalingMetricSpecification]
(Int -> ReadS PredictiveScalingMetricSpecification)
-> ReadS [PredictiveScalingMetricSpecification]
-> ReadPrec PredictiveScalingMetricSpecification
-> ReadPrec [PredictiveScalingMetricSpecification]
-> Read PredictiveScalingMetricSpecification
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PredictiveScalingMetricSpecification]
$creadListPrec :: ReadPrec [PredictiveScalingMetricSpecification]
readPrec :: ReadPrec PredictiveScalingMetricSpecification
$creadPrec :: ReadPrec PredictiveScalingMetricSpecification
readList :: ReadS [PredictiveScalingMetricSpecification]
$creadList :: ReadS [PredictiveScalingMetricSpecification]
readsPrec :: Int -> ReadS PredictiveScalingMetricSpecification
$creadsPrec :: Int -> ReadS PredictiveScalingMetricSpecification
Prelude.Read, Int -> PredictiveScalingMetricSpecification -> ShowS
[PredictiveScalingMetricSpecification] -> ShowS
PredictiveScalingMetricSpecification -> String
(Int -> PredictiveScalingMetricSpecification -> ShowS)
-> (PredictiveScalingMetricSpecification -> String)
-> ([PredictiveScalingMetricSpecification] -> ShowS)
-> Show PredictiveScalingMetricSpecification
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PredictiveScalingMetricSpecification] -> ShowS
$cshowList :: [PredictiveScalingMetricSpecification] -> ShowS
show :: PredictiveScalingMetricSpecification -> String
$cshow :: PredictiveScalingMetricSpecification -> String
showsPrec :: Int -> PredictiveScalingMetricSpecification -> ShowS
$cshowsPrec :: Int -> PredictiveScalingMetricSpecification -> ShowS
Prelude.Show, (forall x.
PredictiveScalingMetricSpecification
-> Rep PredictiveScalingMetricSpecification x)
-> (forall x.
Rep PredictiveScalingMetricSpecification x
-> PredictiveScalingMetricSpecification)
-> Generic PredictiveScalingMetricSpecification
forall x.
Rep PredictiveScalingMetricSpecification x
-> PredictiveScalingMetricSpecification
forall x.
PredictiveScalingMetricSpecification
-> Rep PredictiveScalingMetricSpecification x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PredictiveScalingMetricSpecification x
-> PredictiveScalingMetricSpecification
$cfrom :: forall x.
PredictiveScalingMetricSpecification
-> Rep PredictiveScalingMetricSpecification x
Prelude.Generic)
newPredictiveScalingMetricSpecification ::
Prelude.Double ->
PredictiveScalingMetricSpecification
newPredictiveScalingMetricSpecification :: Double -> PredictiveScalingMetricSpecification
newPredictiveScalingMetricSpecification Double
pTargetValue_ =
PredictiveScalingMetricSpecification' :: Maybe PredictiveScalingPredefinedScalingMetric
-> Maybe PredictiveScalingPredefinedMetricPair
-> Maybe PredictiveScalingPredefinedLoadMetric
-> Double
-> PredictiveScalingMetricSpecification
PredictiveScalingMetricSpecification'
{ $sel:predefinedScalingMetricSpecification:PredictiveScalingMetricSpecification' :: Maybe PredictiveScalingPredefinedScalingMetric
predefinedScalingMetricSpecification =
Maybe PredictiveScalingPredefinedScalingMetric
forall a. Maybe a
Prelude.Nothing,
$sel:predefinedMetricPairSpecification:PredictiveScalingMetricSpecification' :: Maybe PredictiveScalingPredefinedMetricPair
predefinedMetricPairSpecification =
Maybe PredictiveScalingPredefinedMetricPair
forall a. Maybe a
Prelude.Nothing,
$sel:predefinedLoadMetricSpecification:PredictiveScalingMetricSpecification' :: Maybe PredictiveScalingPredefinedLoadMetric
predefinedLoadMetricSpecification =
Maybe PredictiveScalingPredefinedLoadMetric
forall a. Maybe a
Prelude.Nothing,
$sel:targetValue:PredictiveScalingMetricSpecification' :: Double
targetValue = Double
pTargetValue_
}
predictiveScalingMetricSpecification_predefinedScalingMetricSpecification :: Lens.Lens' PredictiveScalingMetricSpecification (Prelude.Maybe PredictiveScalingPredefinedScalingMetric)
predictiveScalingMetricSpecification_predefinedScalingMetricSpecification :: (Maybe PredictiveScalingPredefinedScalingMetric
-> f (Maybe PredictiveScalingPredefinedScalingMetric))
-> PredictiveScalingMetricSpecification
-> f PredictiveScalingMetricSpecification
predictiveScalingMetricSpecification_predefinedScalingMetricSpecification = (PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedScalingMetric)
-> (PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedScalingMetric
-> PredictiveScalingMetricSpecification)
-> Lens
PredictiveScalingMetricSpecification
PredictiveScalingMetricSpecification
(Maybe PredictiveScalingPredefinedScalingMetric)
(Maybe PredictiveScalingPredefinedScalingMetric)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictiveScalingMetricSpecification' {Maybe PredictiveScalingPredefinedScalingMetric
predefinedScalingMetricSpecification :: Maybe PredictiveScalingPredefinedScalingMetric
$sel:predefinedScalingMetricSpecification:PredictiveScalingMetricSpecification' :: PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedScalingMetric
predefinedScalingMetricSpecification} -> Maybe PredictiveScalingPredefinedScalingMetric
predefinedScalingMetricSpecification) (\s :: PredictiveScalingMetricSpecification
s@PredictiveScalingMetricSpecification' {} Maybe PredictiveScalingPredefinedScalingMetric
a -> PredictiveScalingMetricSpecification
s {$sel:predefinedScalingMetricSpecification:PredictiveScalingMetricSpecification' :: Maybe PredictiveScalingPredefinedScalingMetric
predefinedScalingMetricSpecification = Maybe PredictiveScalingPredefinedScalingMetric
a} :: PredictiveScalingMetricSpecification)
predictiveScalingMetricSpecification_predefinedMetricPairSpecification :: Lens.Lens' PredictiveScalingMetricSpecification (Prelude.Maybe PredictiveScalingPredefinedMetricPair)
predictiveScalingMetricSpecification_predefinedMetricPairSpecification :: (Maybe PredictiveScalingPredefinedMetricPair
-> f (Maybe PredictiveScalingPredefinedMetricPair))
-> PredictiveScalingMetricSpecification
-> f PredictiveScalingMetricSpecification
predictiveScalingMetricSpecification_predefinedMetricPairSpecification = (PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedMetricPair)
-> (PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedMetricPair
-> PredictiveScalingMetricSpecification)
-> Lens
PredictiveScalingMetricSpecification
PredictiveScalingMetricSpecification
(Maybe PredictiveScalingPredefinedMetricPair)
(Maybe PredictiveScalingPredefinedMetricPair)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictiveScalingMetricSpecification' {Maybe PredictiveScalingPredefinedMetricPair
predefinedMetricPairSpecification :: Maybe PredictiveScalingPredefinedMetricPair
$sel:predefinedMetricPairSpecification:PredictiveScalingMetricSpecification' :: PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedMetricPair
predefinedMetricPairSpecification} -> Maybe PredictiveScalingPredefinedMetricPair
predefinedMetricPairSpecification) (\s :: PredictiveScalingMetricSpecification
s@PredictiveScalingMetricSpecification' {} Maybe PredictiveScalingPredefinedMetricPair
a -> PredictiveScalingMetricSpecification
s {$sel:predefinedMetricPairSpecification:PredictiveScalingMetricSpecification' :: Maybe PredictiveScalingPredefinedMetricPair
predefinedMetricPairSpecification = Maybe PredictiveScalingPredefinedMetricPair
a} :: PredictiveScalingMetricSpecification)
predictiveScalingMetricSpecification_predefinedLoadMetricSpecification :: Lens.Lens' PredictiveScalingMetricSpecification (Prelude.Maybe PredictiveScalingPredefinedLoadMetric)
predictiveScalingMetricSpecification_predefinedLoadMetricSpecification :: (Maybe PredictiveScalingPredefinedLoadMetric
-> f (Maybe PredictiveScalingPredefinedLoadMetric))
-> PredictiveScalingMetricSpecification
-> f PredictiveScalingMetricSpecification
predictiveScalingMetricSpecification_predefinedLoadMetricSpecification = (PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedLoadMetric)
-> (PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedLoadMetric
-> PredictiveScalingMetricSpecification)
-> Lens
PredictiveScalingMetricSpecification
PredictiveScalingMetricSpecification
(Maybe PredictiveScalingPredefinedLoadMetric)
(Maybe PredictiveScalingPredefinedLoadMetric)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictiveScalingMetricSpecification' {Maybe PredictiveScalingPredefinedLoadMetric
predefinedLoadMetricSpecification :: Maybe PredictiveScalingPredefinedLoadMetric
$sel:predefinedLoadMetricSpecification:PredictiveScalingMetricSpecification' :: PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedLoadMetric
predefinedLoadMetricSpecification} -> Maybe PredictiveScalingPredefinedLoadMetric
predefinedLoadMetricSpecification) (\s :: PredictiveScalingMetricSpecification
s@PredictiveScalingMetricSpecification' {} Maybe PredictiveScalingPredefinedLoadMetric
a -> PredictiveScalingMetricSpecification
s {$sel:predefinedLoadMetricSpecification:PredictiveScalingMetricSpecification' :: Maybe PredictiveScalingPredefinedLoadMetric
predefinedLoadMetricSpecification = Maybe PredictiveScalingPredefinedLoadMetric
a} :: PredictiveScalingMetricSpecification)
predictiveScalingMetricSpecification_targetValue :: Lens.Lens' PredictiveScalingMetricSpecification Prelude.Double
predictiveScalingMetricSpecification_targetValue :: (Double -> f Double)
-> PredictiveScalingMetricSpecification
-> f PredictiveScalingMetricSpecification
predictiveScalingMetricSpecification_targetValue = (PredictiveScalingMetricSpecification -> Double)
-> (PredictiveScalingMetricSpecification
-> Double -> PredictiveScalingMetricSpecification)
-> Lens
PredictiveScalingMetricSpecification
PredictiveScalingMetricSpecification
Double
Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictiveScalingMetricSpecification' {Double
targetValue :: Double
$sel:targetValue:PredictiveScalingMetricSpecification' :: PredictiveScalingMetricSpecification -> Double
targetValue} -> Double
targetValue) (\s :: PredictiveScalingMetricSpecification
s@PredictiveScalingMetricSpecification' {} Double
a -> PredictiveScalingMetricSpecification
s {$sel:targetValue:PredictiveScalingMetricSpecification' :: Double
targetValue = Double
a} :: PredictiveScalingMetricSpecification)
instance
Core.FromXML
PredictiveScalingMetricSpecification
where
parseXML :: [Node] -> Either String PredictiveScalingMetricSpecification
parseXML [Node]
x =
Maybe PredictiveScalingPredefinedScalingMetric
-> Maybe PredictiveScalingPredefinedMetricPair
-> Maybe PredictiveScalingPredefinedLoadMetric
-> Double
-> PredictiveScalingMetricSpecification
PredictiveScalingMetricSpecification'
(Maybe PredictiveScalingPredefinedScalingMetric
-> Maybe PredictiveScalingPredefinedMetricPair
-> Maybe PredictiveScalingPredefinedLoadMetric
-> Double
-> PredictiveScalingMetricSpecification)
-> Either String (Maybe PredictiveScalingPredefinedScalingMetric)
-> Either
String
(Maybe PredictiveScalingPredefinedMetricPair
-> Maybe PredictiveScalingPredefinedLoadMetric
-> Double
-> PredictiveScalingMetricSpecification)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node]
-> Text
-> Either String (Maybe PredictiveScalingPredefinedScalingMetric)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PredefinedScalingMetricSpecification")
Either
String
(Maybe PredictiveScalingPredefinedMetricPair
-> Maybe PredictiveScalingPredefinedLoadMetric
-> Double
-> PredictiveScalingMetricSpecification)
-> Either String (Maybe PredictiveScalingPredefinedMetricPair)
-> Either
String
(Maybe PredictiveScalingPredefinedLoadMetric
-> Double -> PredictiveScalingMetricSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text
-> Either String (Maybe PredictiveScalingPredefinedMetricPair)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PredefinedMetricPairSpecification")
Either
String
(Maybe PredictiveScalingPredefinedLoadMetric
-> Double -> PredictiveScalingMetricSpecification)
-> Either String (Maybe PredictiveScalingPredefinedLoadMetric)
-> Either String (Double -> PredictiveScalingMetricSpecification)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text
-> Either String (Maybe PredictiveScalingPredefinedLoadMetric)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"PredefinedLoadMetricSpecification")
Either String (Double -> PredictiveScalingMetricSpecification)
-> Either String Double
-> Either String PredictiveScalingMetricSpecification
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String Double
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"TargetValue")
instance
Prelude.Hashable
PredictiveScalingMetricSpecification
instance
Prelude.NFData
PredictiveScalingMetricSpecification
instance
Core.ToQuery
PredictiveScalingMetricSpecification
where
toQuery :: PredictiveScalingMetricSpecification -> QueryString
toQuery PredictiveScalingMetricSpecification' {Double
Maybe PredictiveScalingPredefinedLoadMetric
Maybe PredictiveScalingPredefinedMetricPair
Maybe PredictiveScalingPredefinedScalingMetric
targetValue :: Double
predefinedLoadMetricSpecification :: Maybe PredictiveScalingPredefinedLoadMetric
predefinedMetricPairSpecification :: Maybe PredictiveScalingPredefinedMetricPair
predefinedScalingMetricSpecification :: Maybe PredictiveScalingPredefinedScalingMetric
$sel:targetValue:PredictiveScalingMetricSpecification' :: PredictiveScalingMetricSpecification -> Double
$sel:predefinedLoadMetricSpecification:PredictiveScalingMetricSpecification' :: PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedLoadMetric
$sel:predefinedMetricPairSpecification:PredictiveScalingMetricSpecification' :: PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedMetricPair
$sel:predefinedScalingMetricSpecification:PredictiveScalingMetricSpecification' :: PredictiveScalingMetricSpecification
-> Maybe PredictiveScalingPredefinedScalingMetric
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"PredefinedScalingMetricSpecification"
ByteString
-> Maybe PredictiveScalingPredefinedScalingMetric -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PredictiveScalingPredefinedScalingMetric
predefinedScalingMetricSpecification,
ByteString
"PredefinedMetricPairSpecification"
ByteString
-> Maybe PredictiveScalingPredefinedMetricPair -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PredictiveScalingPredefinedMetricPair
predefinedMetricPairSpecification,
ByteString
"PredefinedLoadMetricSpecification"
ByteString
-> Maybe PredictiveScalingPredefinedLoadMetric -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PredictiveScalingPredefinedLoadMetric
predefinedLoadMetricSpecification,
ByteString
"TargetValue" ByteString -> Double -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Double
targetValue
]