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