{-# 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.RefreshPreferences where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data RefreshPreferences = RefreshPreferences'
{
RefreshPreferences -> Maybe Natural
minHealthyPercentage :: Prelude.Maybe Prelude.Natural,
RefreshPreferences -> Maybe Bool
skipMatching :: Prelude.Maybe Prelude.Bool,
RefreshPreferences -> Maybe [Natural]
checkpointPercentages :: Prelude.Maybe [Prelude.Natural],
RefreshPreferences -> Maybe Natural
checkpointDelay :: Prelude.Maybe Prelude.Natural,
RefreshPreferences -> Maybe Natural
instanceWarmup :: Prelude.Maybe Prelude.Natural
}
deriving (RefreshPreferences -> RefreshPreferences -> Bool
(RefreshPreferences -> RefreshPreferences -> Bool)
-> (RefreshPreferences -> RefreshPreferences -> Bool)
-> Eq RefreshPreferences
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: RefreshPreferences -> RefreshPreferences -> Bool
$c/= :: RefreshPreferences -> RefreshPreferences -> Bool
== :: RefreshPreferences -> RefreshPreferences -> Bool
$c== :: RefreshPreferences -> RefreshPreferences -> Bool
Prelude.Eq, ReadPrec [RefreshPreferences]
ReadPrec RefreshPreferences
Int -> ReadS RefreshPreferences
ReadS [RefreshPreferences]
(Int -> ReadS RefreshPreferences)
-> ReadS [RefreshPreferences]
-> ReadPrec RefreshPreferences
-> ReadPrec [RefreshPreferences]
-> Read RefreshPreferences
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [RefreshPreferences]
$creadListPrec :: ReadPrec [RefreshPreferences]
readPrec :: ReadPrec RefreshPreferences
$creadPrec :: ReadPrec RefreshPreferences
readList :: ReadS [RefreshPreferences]
$creadList :: ReadS [RefreshPreferences]
readsPrec :: Int -> ReadS RefreshPreferences
$creadsPrec :: Int -> ReadS RefreshPreferences
Prelude.Read, Int -> RefreshPreferences -> ShowS
[RefreshPreferences] -> ShowS
RefreshPreferences -> String
(Int -> RefreshPreferences -> ShowS)
-> (RefreshPreferences -> String)
-> ([RefreshPreferences] -> ShowS)
-> Show RefreshPreferences
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [RefreshPreferences] -> ShowS
$cshowList :: [RefreshPreferences] -> ShowS
show :: RefreshPreferences -> String
$cshow :: RefreshPreferences -> String
showsPrec :: Int -> RefreshPreferences -> ShowS
$cshowsPrec :: Int -> RefreshPreferences -> ShowS
Prelude.Show, (forall x. RefreshPreferences -> Rep RefreshPreferences x)
-> (forall x. Rep RefreshPreferences x -> RefreshPreferences)
-> Generic RefreshPreferences
forall x. Rep RefreshPreferences x -> RefreshPreferences
forall x. RefreshPreferences -> Rep RefreshPreferences x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep RefreshPreferences x -> RefreshPreferences
$cfrom :: forall x. RefreshPreferences -> Rep RefreshPreferences x
Prelude.Generic)
newRefreshPreferences ::
RefreshPreferences
newRefreshPreferences :: RefreshPreferences
newRefreshPreferences =
RefreshPreferences' :: Maybe Natural
-> Maybe Bool
-> Maybe [Natural]
-> Maybe Natural
-> Maybe Natural
-> RefreshPreferences
RefreshPreferences'
{ $sel:minHealthyPercentage:RefreshPreferences' :: Maybe Natural
minHealthyPercentage =
Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:skipMatching:RefreshPreferences' :: Maybe Bool
skipMatching = Maybe Bool
forall a. Maybe a
Prelude.Nothing,
$sel:checkpointPercentages:RefreshPreferences' :: Maybe [Natural]
checkpointPercentages = Maybe [Natural]
forall a. Maybe a
Prelude.Nothing,
$sel:checkpointDelay:RefreshPreferences' :: Maybe Natural
checkpointDelay = Maybe Natural
forall a. Maybe a
Prelude.Nothing,
$sel:instanceWarmup:RefreshPreferences' :: Maybe Natural
instanceWarmup = Maybe Natural
forall a. Maybe a
Prelude.Nothing
}
refreshPreferences_minHealthyPercentage :: Lens.Lens' RefreshPreferences (Prelude.Maybe Prelude.Natural)
refreshPreferences_minHealthyPercentage :: (Maybe Natural -> f (Maybe Natural))
-> RefreshPreferences -> f RefreshPreferences
refreshPreferences_minHealthyPercentage = (RefreshPreferences -> Maybe Natural)
-> (RefreshPreferences -> Maybe Natural -> RefreshPreferences)
-> Lens
RefreshPreferences
RefreshPreferences
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshPreferences' {Maybe Natural
minHealthyPercentage :: Maybe Natural
$sel:minHealthyPercentage:RefreshPreferences' :: RefreshPreferences -> Maybe Natural
minHealthyPercentage} -> Maybe Natural
minHealthyPercentage) (\s :: RefreshPreferences
s@RefreshPreferences' {} Maybe Natural
a -> RefreshPreferences
s {$sel:minHealthyPercentage:RefreshPreferences' :: Maybe Natural
minHealthyPercentage = Maybe Natural
a} :: RefreshPreferences)
refreshPreferences_skipMatching :: Lens.Lens' RefreshPreferences (Prelude.Maybe Prelude.Bool)
refreshPreferences_skipMatching :: (Maybe Bool -> f (Maybe Bool))
-> RefreshPreferences -> f RefreshPreferences
refreshPreferences_skipMatching = (RefreshPreferences -> Maybe Bool)
-> (RefreshPreferences -> Maybe Bool -> RefreshPreferences)
-> Lens
RefreshPreferences RefreshPreferences (Maybe Bool) (Maybe Bool)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshPreferences' {Maybe Bool
skipMatching :: Maybe Bool
$sel:skipMatching:RefreshPreferences' :: RefreshPreferences -> Maybe Bool
skipMatching} -> Maybe Bool
skipMatching) (\s :: RefreshPreferences
s@RefreshPreferences' {} Maybe Bool
a -> RefreshPreferences
s {$sel:skipMatching:RefreshPreferences' :: Maybe Bool
skipMatching = Maybe Bool
a} :: RefreshPreferences)
refreshPreferences_checkpointPercentages :: Lens.Lens' RefreshPreferences (Prelude.Maybe [Prelude.Natural])
refreshPreferences_checkpointPercentages :: (Maybe [Natural] -> f (Maybe [Natural]))
-> RefreshPreferences -> f RefreshPreferences
refreshPreferences_checkpointPercentages = (RefreshPreferences -> Maybe [Natural])
-> (RefreshPreferences -> Maybe [Natural] -> RefreshPreferences)
-> Lens
RefreshPreferences
RefreshPreferences
(Maybe [Natural])
(Maybe [Natural])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshPreferences' {Maybe [Natural]
checkpointPercentages :: Maybe [Natural]
$sel:checkpointPercentages:RefreshPreferences' :: RefreshPreferences -> Maybe [Natural]
checkpointPercentages} -> Maybe [Natural]
checkpointPercentages) (\s :: RefreshPreferences
s@RefreshPreferences' {} Maybe [Natural]
a -> RefreshPreferences
s {$sel:checkpointPercentages:RefreshPreferences' :: Maybe [Natural]
checkpointPercentages = Maybe [Natural]
a} :: RefreshPreferences) ((Maybe [Natural] -> f (Maybe [Natural]))
-> RefreshPreferences -> f RefreshPreferences)
-> ((Maybe [Natural] -> f (Maybe [Natural]))
-> Maybe [Natural] -> f (Maybe [Natural]))
-> (Maybe [Natural] -> f (Maybe [Natural]))
-> RefreshPreferences
-> f RefreshPreferences
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Natural] [Natural] [Natural] [Natural]
-> Iso
(Maybe [Natural])
(Maybe [Natural])
(Maybe [Natural])
(Maybe [Natural])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Natural] [Natural] [Natural] [Natural]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
refreshPreferences_checkpointDelay :: Lens.Lens' RefreshPreferences (Prelude.Maybe Prelude.Natural)
refreshPreferences_checkpointDelay :: (Maybe Natural -> f (Maybe Natural))
-> RefreshPreferences -> f RefreshPreferences
refreshPreferences_checkpointDelay = (RefreshPreferences -> Maybe Natural)
-> (RefreshPreferences -> Maybe Natural -> RefreshPreferences)
-> Lens
RefreshPreferences
RefreshPreferences
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshPreferences' {Maybe Natural
checkpointDelay :: Maybe Natural
$sel:checkpointDelay:RefreshPreferences' :: RefreshPreferences -> Maybe Natural
checkpointDelay} -> Maybe Natural
checkpointDelay) (\s :: RefreshPreferences
s@RefreshPreferences' {} Maybe Natural
a -> RefreshPreferences
s {$sel:checkpointDelay:RefreshPreferences' :: Maybe Natural
checkpointDelay = Maybe Natural
a} :: RefreshPreferences)
refreshPreferences_instanceWarmup :: Lens.Lens' RefreshPreferences (Prelude.Maybe Prelude.Natural)
refreshPreferences_instanceWarmup :: (Maybe Natural -> f (Maybe Natural))
-> RefreshPreferences -> f RefreshPreferences
refreshPreferences_instanceWarmup = (RefreshPreferences -> Maybe Natural)
-> (RefreshPreferences -> Maybe Natural -> RefreshPreferences)
-> Lens
RefreshPreferences
RefreshPreferences
(Maybe Natural)
(Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\RefreshPreferences' {Maybe Natural
instanceWarmup :: Maybe Natural
$sel:instanceWarmup:RefreshPreferences' :: RefreshPreferences -> Maybe Natural
instanceWarmup} -> Maybe Natural
instanceWarmup) (\s :: RefreshPreferences
s@RefreshPreferences' {} Maybe Natural
a -> RefreshPreferences
s {$sel:instanceWarmup:RefreshPreferences' :: Maybe Natural
instanceWarmup = Maybe Natural
a} :: RefreshPreferences)
instance Core.FromXML RefreshPreferences where
parseXML :: [Node] -> Either String RefreshPreferences
parseXML [Node]
x =
Maybe Natural
-> Maybe Bool
-> Maybe [Natural]
-> Maybe Natural
-> Maybe Natural
-> RefreshPreferences
RefreshPreferences'
(Maybe Natural
-> Maybe Bool
-> Maybe [Natural]
-> Maybe Natural
-> Maybe Natural
-> RefreshPreferences)
-> Either String (Maybe Natural)
-> Either
String
(Maybe Bool
-> Maybe [Natural]
-> Maybe Natural
-> Maybe Natural
-> RefreshPreferences)
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
"MinHealthyPercentage")
Either
String
(Maybe Bool
-> Maybe [Natural]
-> Maybe Natural
-> Maybe Natural
-> RefreshPreferences)
-> Either String (Maybe Bool)
-> Either
String
(Maybe [Natural]
-> Maybe Natural -> Maybe Natural -> RefreshPreferences)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Bool)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SkipMatching")
Either
String
(Maybe [Natural]
-> Maybe Natural -> Maybe Natural -> RefreshPreferences)
-> Either String (Maybe [Natural])
-> Either
String (Maybe Natural -> Maybe Natural -> RefreshPreferences)
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
"CheckpointPercentages"
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 (Maybe [Natural]))
-> Either String (Maybe [Natural])
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
Prelude.>>= ([Node] -> Either String [Natural])
-> [Node] -> Either String (Maybe [Natural])
forall (f :: * -> *) a b.
Applicative f =>
([a] -> f b) -> [a] -> f (Maybe b)
Core.may (Text -> [Node] -> Either String [Natural]
forall a. FromXML a => Text -> [Node] -> Either String [a]
Core.parseXMLList Text
"member")
)
Either
String (Maybe Natural -> Maybe Natural -> RefreshPreferences)
-> Either String (Maybe Natural)
-> Either String (Maybe Natural -> RefreshPreferences)
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
"CheckpointDelay")
Either String (Maybe Natural -> RefreshPreferences)
-> Either String (Maybe Natural)
-> Either String RefreshPreferences
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
"InstanceWarmup")
instance Prelude.Hashable RefreshPreferences
instance Prelude.NFData RefreshPreferences
instance Core.ToQuery RefreshPreferences where
toQuery :: RefreshPreferences -> QueryString
toQuery RefreshPreferences' {Maybe Bool
Maybe Natural
Maybe [Natural]
instanceWarmup :: Maybe Natural
checkpointDelay :: Maybe Natural
checkpointPercentages :: Maybe [Natural]
skipMatching :: Maybe Bool
minHealthyPercentage :: Maybe Natural
$sel:instanceWarmup:RefreshPreferences' :: RefreshPreferences -> Maybe Natural
$sel:checkpointDelay:RefreshPreferences' :: RefreshPreferences -> Maybe Natural
$sel:checkpointPercentages:RefreshPreferences' :: RefreshPreferences -> Maybe [Natural]
$sel:skipMatching:RefreshPreferences' :: RefreshPreferences -> Maybe Bool
$sel:minHealthyPercentage:RefreshPreferences' :: RefreshPreferences -> Maybe Natural
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"MinHealthyPercentage" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
minHealthyPercentage,
ByteString
"SkipMatching" ByteString -> Maybe Bool -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Bool
skipMatching,
ByteString
"CheckpointPercentages"
ByteString -> QueryString -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe QueryString -> QueryString
forall a. ToQuery a => a -> QueryString
Core.toQuery
( ByteString -> [Natural] -> QueryString
forall a.
(IsList a, ToQuery (Item a)) =>
ByteString -> a -> QueryString
Core.toQueryList ByteString
"member"
([Natural] -> QueryString) -> Maybe [Natural] -> Maybe QueryString
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [Natural]
checkpointPercentages
),
ByteString
"CheckpointDelay" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
checkpointDelay,
ByteString
"InstanceWarmup" ByteString -> Maybe Natural -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Natural
instanceWarmup
]