{-# 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.PredictiveScalingConfiguration where
import Amazonka.AutoScaling.Types.PredictiveScalingMaxCapacityBreachBehavior
import Amazonka.AutoScaling.Types.PredictiveScalingMetricSpecification
import Amazonka.AutoScaling.Types.PredictiveScalingMode
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PredictiveScalingConfiguration = PredictiveScalingConfiguration'
{
PredictiveScalingConfiguration -> Maybe Natural
schedulingBufferTime :: Prelude.Maybe Prelude.Natural,
PredictiveScalingConfiguration -> Maybe Natural
maxCapacityBuffer :: Prelude.Maybe Prelude.Natural,
PredictiveScalingConfiguration -> Maybe PredictiveScalingMode
mode :: Prelude.Maybe PredictiveScalingMode,
PredictiveScalingConfiguration
-> Maybe PredictiveScalingMaxCapacityBreachBehavior
maxCapacityBreachBehavior :: Prelude.Maybe PredictiveScalingMaxCapacityBreachBehavior,
PredictiveScalingConfiguration
-> [PredictiveScalingMetricSpecification]
metricSpecifications :: [PredictiveScalingMetricSpecification]
}
deriving (PredictiveScalingConfiguration
-> PredictiveScalingConfiguration -> Bool
(PredictiveScalingConfiguration
-> PredictiveScalingConfiguration -> Bool)
-> (PredictiveScalingConfiguration
-> PredictiveScalingConfiguration -> Bool)
-> Eq PredictiveScalingConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PredictiveScalingConfiguration
-> PredictiveScalingConfiguration -> Bool
$c/= :: PredictiveScalingConfiguration
-> PredictiveScalingConfiguration -> Bool
== :: PredictiveScalingConfiguration
-> PredictiveScalingConfiguration -> Bool
$c== :: PredictiveScalingConfiguration
-> PredictiveScalingConfiguration -> Bool
Prelude.Eq, ReadPrec [PredictiveScalingConfiguration]
ReadPrec PredictiveScalingConfiguration
Int -> ReadS PredictiveScalingConfiguration
ReadS [PredictiveScalingConfiguration]
(Int -> ReadS PredictiveScalingConfiguration)
-> ReadS [PredictiveScalingConfiguration]
-> ReadPrec PredictiveScalingConfiguration
-> ReadPrec [PredictiveScalingConfiguration]
-> Read PredictiveScalingConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PredictiveScalingConfiguration]
$creadListPrec :: ReadPrec [PredictiveScalingConfiguration]
readPrec :: ReadPrec PredictiveScalingConfiguration
$creadPrec :: ReadPrec PredictiveScalingConfiguration
readList :: ReadS [PredictiveScalingConfiguration]
$creadList :: ReadS [PredictiveScalingConfiguration]
readsPrec :: Int -> ReadS PredictiveScalingConfiguration
$creadsPrec :: Int -> ReadS PredictiveScalingConfiguration
Prelude.Read, Int -> PredictiveScalingConfiguration -> ShowS
[PredictiveScalingConfiguration] -> ShowS
PredictiveScalingConfiguration -> String
(Int -> PredictiveScalingConfiguration -> ShowS)
-> (PredictiveScalingConfiguration -> String)
-> ([PredictiveScalingConfiguration] -> ShowS)
-> Show PredictiveScalingConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PredictiveScalingConfiguration] -> ShowS
$cshowList :: [PredictiveScalingConfiguration] -> ShowS
show :: PredictiveScalingConfiguration -> String
$cshow :: PredictiveScalingConfiguration -> String
showsPrec :: Int -> PredictiveScalingConfiguration -> ShowS
$cshowsPrec :: Int -> PredictiveScalingConfiguration -> ShowS
Prelude.Show, (forall x.
PredictiveScalingConfiguration
-> Rep PredictiveScalingConfiguration x)
-> (forall x.
Rep PredictiveScalingConfiguration x
-> PredictiveScalingConfiguration)
-> Generic PredictiveScalingConfiguration
forall x.
Rep PredictiveScalingConfiguration x
-> PredictiveScalingConfiguration
forall x.
PredictiveScalingConfiguration
-> Rep PredictiveScalingConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PredictiveScalingConfiguration x
-> PredictiveScalingConfiguration
$cfrom :: forall x.
PredictiveScalingConfiguration
-> Rep PredictiveScalingConfiguration x
Prelude.Generic)
newPredictiveScalingConfiguration ::
PredictiveScalingConfiguration
newPredictiveScalingConfiguration :: PredictiveScalingConfiguration
newPredictiveScalingConfiguration =
PredictiveScalingConfiguration' :: Maybe Natural
-> Maybe Natural
-> Maybe PredictiveScalingMode
-> Maybe PredictiveScalingMaxCapacityBreachBehavior
-> [PredictiveScalingMetricSpecification]
-> PredictiveScalingConfiguration
PredictiveScalingConfiguration'
{ $sel:schedulingBufferTime:PredictiveScalingConfiguration' :: Maybe Natural
schedulingBufferTime =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:maxCapacityBuffer:PredictiveScalingConfiguration' :: Maybe Natural
maxCapacityBuffer = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:mode:PredictiveScalingConfiguration' :: Maybe PredictiveScalingMode
mode = Maybe PredictiveScalingMode
forall a. Maybe a
Prelude.Nothing,
$sel:maxCapacityBreachBehavior:PredictiveScalingConfiguration' :: Maybe PredictiveScalingMaxCapacityBreachBehavior
maxCapacityBreachBehavior = Maybe PredictiveScalingMaxCapacityBreachBehavior
forall a. Maybe a
Prelude.Nothing,
$sel:metricSpecifications:PredictiveScalingConfiguration' :: [PredictiveScalingMetricSpecification]
metricSpecifications = [PredictiveScalingMetricSpecification]
forall a. Monoid a => a
Prelude.mempty
}
predictiveScalingConfiguration_schedulingBufferTime :: Lens.Lens' PredictiveScalingConfiguration (Prelude.Maybe Prelude.Natural)
predictiveScalingConfiguration_schedulingBufferTime :: (Maybe Natural -> f (Maybe Natural))
-> PredictiveScalingConfiguration
-> f PredictiveScalingConfiguration
predictiveScalingConfiguration_schedulingBufferTime = (PredictiveScalingConfiguration -> Maybe Natural)
-> (PredictiveScalingConfiguration
-> Maybe Natural -> PredictiveScalingConfiguration)
-> Lens
PredictiveScalingConfiguration
PredictiveScalingConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictiveScalingConfiguration' {Maybe Natural
schedulingBufferTime :: Maybe Natural
$sel:schedulingBufferTime:PredictiveScalingConfiguration' :: PredictiveScalingConfiguration -> Maybe Natural
schedulingBufferTime} -> Maybe Natural
schedulingBufferTime) (\s :: PredictiveScalingConfiguration
s@PredictiveScalingConfiguration' {} Maybe Natural
a -> PredictiveScalingConfiguration
s {$sel:schedulingBufferTime:PredictiveScalingConfiguration' :: Maybe Natural
schedulingBufferTime = Maybe Natural
a} :: PredictiveScalingConfiguration)
predictiveScalingConfiguration_maxCapacityBuffer :: Lens.Lens' PredictiveScalingConfiguration (Prelude.Maybe Prelude.Natural)
predictiveScalingConfiguration_maxCapacityBuffer :: (Maybe Natural -> f (Maybe Natural))
-> PredictiveScalingConfiguration
-> f PredictiveScalingConfiguration
predictiveScalingConfiguration_maxCapacityBuffer = (PredictiveScalingConfiguration -> Maybe Natural)
-> (PredictiveScalingConfiguration
-> Maybe Natural -> PredictiveScalingConfiguration)
-> Lens
PredictiveScalingConfiguration
PredictiveScalingConfiguration
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictiveScalingConfiguration' {Maybe Natural
maxCapacityBuffer :: Maybe Natural
$sel:maxCapacityBuffer:PredictiveScalingConfiguration' :: PredictiveScalingConfiguration -> Maybe Natural
maxCapacityBuffer} -> Maybe Natural
maxCapacityBuffer) (\s :: PredictiveScalingConfiguration
s@PredictiveScalingConfiguration' {} Maybe Natural
a -> PredictiveScalingConfiguration
s {$sel:maxCapacityBuffer:PredictiveScalingConfiguration' :: Maybe Natural
maxCapacityBuffer = Maybe Natural
a} :: PredictiveScalingConfiguration)
predictiveScalingConfiguration_mode :: Lens.Lens' PredictiveScalingConfiguration (Prelude.Maybe PredictiveScalingMode)
predictiveScalingConfiguration_mode :: (Maybe PredictiveScalingMode -> f (Maybe PredictiveScalingMode))
-> PredictiveScalingConfiguration
-> f PredictiveScalingConfiguration
predictiveScalingConfiguration_mode = (PredictiveScalingConfiguration -> Maybe PredictiveScalingMode)
-> (PredictiveScalingConfiguration
-> Maybe PredictiveScalingMode -> PredictiveScalingConfiguration)
-> Lens
PredictiveScalingConfiguration
PredictiveScalingConfiguration
(Maybe PredictiveScalingMode)
(Maybe PredictiveScalingMode)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictiveScalingConfiguration' {Maybe PredictiveScalingMode
mode :: Maybe PredictiveScalingMode
$sel:mode:PredictiveScalingConfiguration' :: PredictiveScalingConfiguration -> Maybe PredictiveScalingMode
mode} -> Maybe PredictiveScalingMode
mode) (\s :: PredictiveScalingConfiguration
s@PredictiveScalingConfiguration' {} Maybe PredictiveScalingMode
a -> PredictiveScalingConfiguration
s {$sel:mode:PredictiveScalingConfiguration' :: Maybe PredictiveScalingMode
mode = Maybe PredictiveScalingMode
a} :: PredictiveScalingConfiguration)
predictiveScalingConfiguration_maxCapacityBreachBehavior :: Lens.Lens' PredictiveScalingConfiguration (Prelude.Maybe PredictiveScalingMaxCapacityBreachBehavior)
predictiveScalingConfiguration_maxCapacityBreachBehavior :: (Maybe PredictiveScalingMaxCapacityBreachBehavior
-> f (Maybe PredictiveScalingMaxCapacityBreachBehavior))
-> PredictiveScalingConfiguration
-> f PredictiveScalingConfiguration
predictiveScalingConfiguration_maxCapacityBreachBehavior = (PredictiveScalingConfiguration
-> Maybe PredictiveScalingMaxCapacityBreachBehavior)
-> (PredictiveScalingConfiguration
-> Maybe PredictiveScalingMaxCapacityBreachBehavior
-> PredictiveScalingConfiguration)
-> Lens
PredictiveScalingConfiguration
PredictiveScalingConfiguration
(Maybe PredictiveScalingMaxCapacityBreachBehavior)
(Maybe PredictiveScalingMaxCapacityBreachBehavior)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictiveScalingConfiguration' {Maybe PredictiveScalingMaxCapacityBreachBehavior
maxCapacityBreachBehavior :: Maybe PredictiveScalingMaxCapacityBreachBehavior
$sel:maxCapacityBreachBehavior:PredictiveScalingConfiguration' :: PredictiveScalingConfiguration
-> Maybe PredictiveScalingMaxCapacityBreachBehavior
maxCapacityBreachBehavior} -> Maybe PredictiveScalingMaxCapacityBreachBehavior
maxCapacityBreachBehavior) (\s :: PredictiveScalingConfiguration
s@PredictiveScalingConfiguration' {} Maybe PredictiveScalingMaxCapacityBreachBehavior
a -> PredictiveScalingConfiguration
s {$sel:maxCapacityBreachBehavior:PredictiveScalingConfiguration' :: Maybe PredictiveScalingMaxCapacityBreachBehavior
maxCapacityBreachBehavior = Maybe PredictiveScalingMaxCapacityBreachBehavior
a} :: PredictiveScalingConfiguration)
predictiveScalingConfiguration_metricSpecifications :: Lens.Lens' PredictiveScalingConfiguration [PredictiveScalingMetricSpecification]
predictiveScalingConfiguration_metricSpecifications :: ([PredictiveScalingMetricSpecification]
-> f [PredictiveScalingMetricSpecification])
-> PredictiveScalingConfiguration
-> f PredictiveScalingConfiguration
predictiveScalingConfiguration_metricSpecifications = (PredictiveScalingConfiguration
-> [PredictiveScalingMetricSpecification])
-> (PredictiveScalingConfiguration
-> [PredictiveScalingMetricSpecification]
-> PredictiveScalingConfiguration)
-> Lens
PredictiveScalingConfiguration
PredictiveScalingConfiguration
[PredictiveScalingMetricSpecification]
[PredictiveScalingMetricSpecification]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictiveScalingConfiguration' {[PredictiveScalingMetricSpecification]
metricSpecifications :: [PredictiveScalingMetricSpecification]
$sel:metricSpecifications:PredictiveScalingConfiguration' :: PredictiveScalingConfiguration
-> [PredictiveScalingMetricSpecification]
metricSpecifications} -> [PredictiveScalingMetricSpecification]
metricSpecifications) (\s :: PredictiveScalingConfiguration
s@PredictiveScalingConfiguration' {} [PredictiveScalingMetricSpecification]
a -> PredictiveScalingConfiguration
s {$sel:metricSpecifications:PredictiveScalingConfiguration' :: [PredictiveScalingMetricSpecification]
metricSpecifications = [PredictiveScalingMetricSpecification]
a} :: PredictiveScalingConfiguration) (([PredictiveScalingMetricSpecification]
-> f [PredictiveScalingMetricSpecification])
-> PredictiveScalingConfiguration
-> f PredictiveScalingConfiguration)
-> (([PredictiveScalingMetricSpecification]
-> f [PredictiveScalingMetricSpecification])
-> [PredictiveScalingMetricSpecification]
-> f [PredictiveScalingMetricSpecification])
-> ([PredictiveScalingMetricSpecification]
-> f [PredictiveScalingMetricSpecification])
-> PredictiveScalingConfiguration
-> f PredictiveScalingConfiguration
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([PredictiveScalingMetricSpecification]
-> f [PredictiveScalingMetricSpecification])
-> [PredictiveScalingMetricSpecification]
-> f [PredictiveScalingMetricSpecification]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
instance Core.FromXML PredictiveScalingConfiguration where
parseXML :: [Node] -> Either String PredictiveScalingConfiguration
parseXML [Node]
x =
Maybe Natural
-> Maybe Natural
-> Maybe PredictiveScalingMode
-> Maybe PredictiveScalingMaxCapacityBreachBehavior
-> [PredictiveScalingMetricSpecification]
-> PredictiveScalingConfiguration
PredictiveScalingConfiguration'
(Maybe Natural
-> Maybe Natural
-> Maybe PredictiveScalingMode
-> Maybe PredictiveScalingMaxCapacityBreachBehavior
-> [PredictiveScalingMetricSpecification]
-> PredictiveScalingConfiguration)
-> Either String (Maybe Natural)
-> Either
String
(Maybe Natural
-> Maybe PredictiveScalingMode
-> Maybe PredictiveScalingMaxCapacityBreachBehavior
-> [PredictiveScalingMetricSpecification]
-> PredictiveScalingConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SchedulingBufferTime")
Either
String
(Maybe Natural
-> Maybe PredictiveScalingMode
-> Maybe PredictiveScalingMaxCapacityBreachBehavior
-> [PredictiveScalingMetricSpecification]
-> PredictiveScalingConfiguration)
-> Either String (Maybe Natural)
-> Either
String
(Maybe PredictiveScalingMode
-> Maybe PredictiveScalingMaxCapacityBreachBehavior
-> [PredictiveScalingMetricSpecification]
-> PredictiveScalingConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Natural)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MaxCapacityBuffer")
Either
String
(Maybe PredictiveScalingMode
-> Maybe PredictiveScalingMaxCapacityBreachBehavior
-> [PredictiveScalingMetricSpecification]
-> PredictiveScalingConfiguration)
-> Either String (Maybe PredictiveScalingMode)
-> Either
String
(Maybe PredictiveScalingMaxCapacityBreachBehavior
-> [PredictiveScalingMetricSpecification]
-> PredictiveScalingConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe PredictiveScalingMode)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"Mode")
Either
String
(Maybe PredictiveScalingMaxCapacityBreachBehavior
-> [PredictiveScalingMetricSpecification]
-> PredictiveScalingConfiguration)
-> Either String (Maybe PredictiveScalingMaxCapacityBreachBehavior)
-> Either
String
([PredictiveScalingMetricSpecification]
-> PredictiveScalingConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node]
-> Text
-> Either String (Maybe PredictiveScalingMaxCapacityBreachBehavior)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MaxCapacityBreachBehavior")
Either
String
([PredictiveScalingMetricSpecification]
-> PredictiveScalingConfiguration)
-> Either String [PredictiveScalingMetricSpecification]
-> Either String PredictiveScalingConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( [Node]
x [Node] -> Text -> Either String (Maybe [Node])
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"MetricSpecifications"
Either String (Maybe [Node]) -> [Node] -> Either String [Node]
forall (f :: * -> *) a. Functor f => f (Maybe a) -> a -> f a
Core..!@ [Node]
forall a. Monoid a => a
Prelude.mempty
Either String [Node]
-> ([Node] -> Either String [PredictiveScalingMetricSpecification])
-> Either String [PredictiveScalingMetricSpecification]
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= Text
-> [Node] -> Either String [PredictiveScalingMetricSpecification]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member"
)
instance
Prelude.Hashable
PredictiveScalingConfiguration
instance
Prelude.NFData
PredictiveScalingConfiguration
instance Core.ToQuery PredictiveScalingConfiguration where
toQuery :: PredictiveScalingConfiguration -> QueryString
toQuery PredictiveScalingConfiguration' {[PredictiveScalingMetricSpecification]
Maybe Natural
Maybe PredictiveScalingMaxCapacityBreachBehavior
Maybe PredictiveScalingMode
metricSpecifications :: [PredictiveScalingMetricSpecification]
maxCapacityBreachBehavior :: Maybe PredictiveScalingMaxCapacityBreachBehavior
mode :: Maybe PredictiveScalingMode
maxCapacityBuffer :: Maybe Natural
schedulingBufferTime :: Maybe Natural
$sel:metricSpecifications:PredictiveScalingConfiguration' :: PredictiveScalingConfiguration
-> [PredictiveScalingMetricSpecification]
$sel:maxCapacityBreachBehavior:PredictiveScalingConfiguration' :: PredictiveScalingConfiguration
-> Maybe PredictiveScalingMaxCapacityBreachBehavior
$sel:mode:PredictiveScalingConfiguration' :: PredictiveScalingConfiguration -> Maybe PredictiveScalingMode
$sel:maxCapacityBuffer:PredictiveScalingConfiguration' :: PredictiveScalingConfiguration -> Maybe Natural
$sel:schedulingBufferTime:PredictiveScalingConfiguration' :: PredictiveScalingConfiguration -> Maybe Natural
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"SchedulingBufferTime" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
schedulingBufferTime,
ByteString
"MaxCapacityBuffer" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
maxCapacityBuffer,
ByteString
"Mode" ByteString -> Maybe PredictiveScalingMode -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PredictiveScalingMode
mode,
ByteString
"MaxCapacityBreachBehavior"
ByteString
-> Maybe PredictiveScalingMaxCapacityBreachBehavior -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe PredictiveScalingMaxCapacityBreachBehavior
maxCapacityBreachBehavior,
ByteString
"MetricSpecifications"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: ByteString -> [PredictiveScalingMetricSpecification] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member" [PredictiveScalingMetricSpecification]
metricSpecifications
]