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