{-# 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.PredictiveScalingPredefinedLoadMetric where
import Amazonka.AutoScaling.Types.PredefinedLoadMetricType
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data PredictiveScalingPredefinedLoadMetric = PredictiveScalingPredefinedLoadMetric'
{
PredictiveScalingPredefinedLoadMetric -> Maybe Text
resourceLabel :: Prelude.Maybe Prelude.Text,
PredictiveScalingPredefinedLoadMetric -> PredefinedLoadMetricType
predefinedMetricType :: PredefinedLoadMetricType
}
deriving (PredictiveScalingPredefinedLoadMetric
-> PredictiveScalingPredefinedLoadMetric -> Bool
(PredictiveScalingPredefinedLoadMetric
-> PredictiveScalingPredefinedLoadMetric -> Bool)
-> (PredictiveScalingPredefinedLoadMetric
-> PredictiveScalingPredefinedLoadMetric -> Bool)
-> Eq PredictiveScalingPredefinedLoadMetric
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PredictiveScalingPredefinedLoadMetric
-> PredictiveScalingPredefinedLoadMetric -> Bool
$c/= :: PredictiveScalingPredefinedLoadMetric
-> PredictiveScalingPredefinedLoadMetric -> Bool
== :: PredictiveScalingPredefinedLoadMetric
-> PredictiveScalingPredefinedLoadMetric -> Bool
$c== :: PredictiveScalingPredefinedLoadMetric
-> PredictiveScalingPredefinedLoadMetric -> Bool
Prelude.Eq, ReadPrec [PredictiveScalingPredefinedLoadMetric]
ReadPrec PredictiveScalingPredefinedLoadMetric
Int -> ReadS PredictiveScalingPredefinedLoadMetric
ReadS [PredictiveScalingPredefinedLoadMetric]
(Int -> ReadS PredictiveScalingPredefinedLoadMetric)
-> ReadS [PredictiveScalingPredefinedLoadMetric]
-> ReadPrec PredictiveScalingPredefinedLoadMetric
-> ReadPrec [PredictiveScalingPredefinedLoadMetric]
-> Read PredictiveScalingPredefinedLoadMetric
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PredictiveScalingPredefinedLoadMetric]
$creadListPrec :: ReadPrec [PredictiveScalingPredefinedLoadMetric]
readPrec :: ReadPrec PredictiveScalingPredefinedLoadMetric
$creadPrec :: ReadPrec PredictiveScalingPredefinedLoadMetric
readList :: ReadS [PredictiveScalingPredefinedLoadMetric]
$creadList :: ReadS [PredictiveScalingPredefinedLoadMetric]
readsPrec :: Int -> ReadS PredictiveScalingPredefinedLoadMetric
$creadsPrec :: Int -> ReadS PredictiveScalingPredefinedLoadMetric
Prelude.Read, Int -> PredictiveScalingPredefinedLoadMetric -> ShowS
[PredictiveScalingPredefinedLoadMetric] -> ShowS
PredictiveScalingPredefinedLoadMetric -> String
(Int -> PredictiveScalingPredefinedLoadMetric -> ShowS)
-> (PredictiveScalingPredefinedLoadMetric -> String)
-> ([PredictiveScalingPredefinedLoadMetric] -> ShowS)
-> Show PredictiveScalingPredefinedLoadMetric
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PredictiveScalingPredefinedLoadMetric] -> ShowS
$cshowList :: [PredictiveScalingPredefinedLoadMetric] -> ShowS
show :: PredictiveScalingPredefinedLoadMetric -> String
$cshow :: PredictiveScalingPredefinedLoadMetric -> String
showsPrec :: Int -> PredictiveScalingPredefinedLoadMetric -> ShowS
$cshowsPrec :: Int -> PredictiveScalingPredefinedLoadMetric -> ShowS
Prelude.Show, (forall x.
PredictiveScalingPredefinedLoadMetric
-> Rep PredictiveScalingPredefinedLoadMetric x)
-> (forall x.
Rep PredictiveScalingPredefinedLoadMetric x
-> PredictiveScalingPredefinedLoadMetric)
-> Generic PredictiveScalingPredefinedLoadMetric
forall x.
Rep PredictiveScalingPredefinedLoadMetric x
-> PredictiveScalingPredefinedLoadMetric
forall x.
PredictiveScalingPredefinedLoadMetric
-> Rep PredictiveScalingPredefinedLoadMetric x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep PredictiveScalingPredefinedLoadMetric x
-> PredictiveScalingPredefinedLoadMetric
$cfrom :: forall x.
PredictiveScalingPredefinedLoadMetric
-> Rep PredictiveScalingPredefinedLoadMetric x
Prelude.Generic)
newPredictiveScalingPredefinedLoadMetric ::
PredefinedLoadMetricType ->
PredictiveScalingPredefinedLoadMetric
newPredictiveScalingPredefinedLoadMetric :: PredefinedLoadMetricType -> PredictiveScalingPredefinedLoadMetric
newPredictiveScalingPredefinedLoadMetric
PredefinedLoadMetricType
pPredefinedMetricType_ =
PredictiveScalingPredefinedLoadMetric' :: Maybe Text
-> PredefinedLoadMetricType
-> PredictiveScalingPredefinedLoadMetric
PredictiveScalingPredefinedLoadMetric'
{ $sel:resourceLabel:PredictiveScalingPredefinedLoadMetric' :: Maybe Text
resourceLabel =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:predefinedMetricType:PredictiveScalingPredefinedLoadMetric' :: PredefinedLoadMetricType
predefinedMetricType =
PredefinedLoadMetricType
pPredefinedMetricType_
}
predictiveScalingPredefinedLoadMetric_resourceLabel :: Lens.Lens' PredictiveScalingPredefinedLoadMetric (Prelude.Maybe Prelude.Text)
predictiveScalingPredefinedLoadMetric_resourceLabel :: (Maybe Text -> f (Maybe Text))
-> PredictiveScalingPredefinedLoadMetric
-> f PredictiveScalingPredefinedLoadMetric
predictiveScalingPredefinedLoadMetric_resourceLabel = (PredictiveScalingPredefinedLoadMetric -> Maybe Text)
-> (PredictiveScalingPredefinedLoadMetric
-> Maybe Text -> PredictiveScalingPredefinedLoadMetric)
-> Lens
PredictiveScalingPredefinedLoadMetric
PredictiveScalingPredefinedLoadMetric
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictiveScalingPredefinedLoadMetric' {Maybe Text
resourceLabel :: Maybe Text
$sel:resourceLabel:PredictiveScalingPredefinedLoadMetric' :: PredictiveScalingPredefinedLoadMetric -> Maybe Text
resourceLabel} -> Maybe Text
resourceLabel) (\s :: PredictiveScalingPredefinedLoadMetric
s@PredictiveScalingPredefinedLoadMetric' {} Maybe Text
a -> PredictiveScalingPredefinedLoadMetric
s {$sel:resourceLabel:PredictiveScalingPredefinedLoadMetric' :: Maybe Text
resourceLabel = Maybe Text
a} :: PredictiveScalingPredefinedLoadMetric)
predictiveScalingPredefinedLoadMetric_predefinedMetricType :: Lens.Lens' PredictiveScalingPredefinedLoadMetric PredefinedLoadMetricType
predictiveScalingPredefinedLoadMetric_predefinedMetricType :: (PredefinedLoadMetricType -> f PredefinedLoadMetricType)
-> PredictiveScalingPredefinedLoadMetric
-> f PredictiveScalingPredefinedLoadMetric
predictiveScalingPredefinedLoadMetric_predefinedMetricType = (PredictiveScalingPredefinedLoadMetric -> PredefinedLoadMetricType)
-> (PredictiveScalingPredefinedLoadMetric
-> PredefinedLoadMetricType
-> PredictiveScalingPredefinedLoadMetric)
-> Lens
PredictiveScalingPredefinedLoadMetric
PredictiveScalingPredefinedLoadMetric
PredefinedLoadMetricType
PredefinedLoadMetricType
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PredictiveScalingPredefinedLoadMetric' {PredefinedLoadMetricType
predefinedMetricType :: PredefinedLoadMetricType
$sel:predefinedMetricType:PredictiveScalingPredefinedLoadMetric' :: PredictiveScalingPredefinedLoadMetric -> PredefinedLoadMetricType
predefinedMetricType} -> PredefinedLoadMetricType
predefinedMetricType) (\s :: PredictiveScalingPredefinedLoadMetric
s@PredictiveScalingPredefinedLoadMetric' {} PredefinedLoadMetricType
a -> PredictiveScalingPredefinedLoadMetric
s {$sel:predefinedMetricType:PredictiveScalingPredefinedLoadMetric' :: PredefinedLoadMetricType
predefinedMetricType = PredefinedLoadMetricType
a} :: PredictiveScalingPredefinedLoadMetric)
instance
Core.FromXML
PredictiveScalingPredefinedLoadMetric
where
parseXML :: [Node] -> Either String PredictiveScalingPredefinedLoadMetric
parseXML [Node]
x =
Maybe Text
-> PredefinedLoadMetricType
-> PredictiveScalingPredefinedLoadMetric
PredictiveScalingPredefinedLoadMetric'
(Maybe Text
-> PredefinedLoadMetricType
-> PredictiveScalingPredefinedLoadMetric)
-> Either String (Maybe Text)
-> Either
String
(PredefinedLoadMetricType -> PredictiveScalingPredefinedLoadMetric)
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
"ResourceLabel")
Either
String
(PredefinedLoadMetricType -> PredictiveScalingPredefinedLoadMetric)
-> Either String PredefinedLoadMetricType
-> Either String PredictiveScalingPredefinedLoadMetric
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String PredefinedLoadMetricType
forall a. FromXML a => [Node] -> Text -> Either String a
Core..@ Text
"PredefinedMetricType")
instance
Prelude.Hashable
PredictiveScalingPredefinedLoadMetric
instance
Prelude.NFData
PredictiveScalingPredefinedLoadMetric
instance
Core.ToQuery
PredictiveScalingPredefinedLoadMetric
where
toQuery :: PredictiveScalingPredefinedLoadMetric -> QueryString
toQuery PredictiveScalingPredefinedLoadMetric' {Maybe Text
PredefinedLoadMetricType
predefinedMetricType :: PredefinedLoadMetricType
resourceLabel :: Maybe Text
$sel:predefinedMetricType:PredictiveScalingPredefinedLoadMetric' :: PredictiveScalingPredefinedLoadMetric -> PredefinedLoadMetricType
$sel:resourceLabel:PredictiveScalingPredefinedLoadMetric' :: PredictiveScalingPredefinedLoadMetric -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"ResourceLabel" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
resourceLabel,
ByteString
"PredefinedMetricType" ByteString -> PredefinedLoadMetricType -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: PredefinedLoadMetricType
predefinedMetricType
]