{-# 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.InstancesDistribution where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InstancesDistribution = InstancesDistribution'
{
InstancesDistribution -> Maybe Text
spotAllocationStrategy :: Prelude.Maybe Prelude.Text,
InstancesDistribution -> Maybe Int
spotInstancePools :: Prelude.Maybe Prelude.Int,
InstancesDistribution -> Maybe Text
spotMaxPrice :: Prelude.Maybe Prelude.Text,
InstancesDistribution -> Maybe Int
onDemandBaseCapacity :: Prelude.Maybe Prelude.Int,
InstancesDistribution -> Maybe Text
onDemandAllocationStrategy :: Prelude.Maybe Prelude.Text,
InstancesDistribution -> Maybe Int
onDemandPercentageAboveBaseCapacity :: Prelude.Maybe Prelude.Int
}
deriving (InstancesDistribution -> InstancesDistribution -> Bool
(InstancesDistribution -> InstancesDistribution -> Bool)
-> (InstancesDistribution -> InstancesDistribution -> Bool)
-> Eq InstancesDistribution
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InstancesDistribution -> InstancesDistribution -> Bool
$c/= :: InstancesDistribution -> InstancesDistribution -> Bool
== :: InstancesDistribution -> InstancesDistribution -> Bool
$c== :: InstancesDistribution -> InstancesDistribution -> Bool
Prelude.Eq, ReadPrec [InstancesDistribution]
ReadPrec InstancesDistribution
Int -> ReadS InstancesDistribution
ReadS [InstancesDistribution]
(Int -> ReadS InstancesDistribution)
-> ReadS [InstancesDistribution]
-> ReadPrec InstancesDistribution
-> ReadPrec [InstancesDistribution]
-> Read InstancesDistribution
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InstancesDistribution]
$creadListPrec :: ReadPrec [InstancesDistribution]
readPrec :: ReadPrec InstancesDistribution
$creadPrec :: ReadPrec InstancesDistribution
readList :: ReadS [InstancesDistribution]
$creadList :: ReadS [InstancesDistribution]
readsPrec :: Int -> ReadS InstancesDistribution
$creadsPrec :: Int -> ReadS InstancesDistribution
Prelude.Read, Int -> InstancesDistribution -> ShowS
[InstancesDistribution] -> ShowS
InstancesDistribution -> String
(Int -> InstancesDistribution -> ShowS)
-> (InstancesDistribution -> String)
-> ([InstancesDistribution] -> ShowS)
-> Show InstancesDistribution
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InstancesDistribution] -> ShowS
$cshowList :: [InstancesDistribution] -> ShowS
show :: InstancesDistribution -> String
$cshow :: InstancesDistribution -> String
showsPrec :: Int -> InstancesDistribution -> ShowS
$cshowsPrec :: Int -> InstancesDistribution -> ShowS
Prelude.Show, (forall x. InstancesDistribution -> Rep InstancesDistribution x)
-> (forall x. Rep InstancesDistribution x -> InstancesDistribution)
-> Generic InstancesDistribution
forall x. Rep InstancesDistribution x -> InstancesDistribution
forall x. InstancesDistribution -> Rep InstancesDistribution x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InstancesDistribution x -> InstancesDistribution
$cfrom :: forall x. InstancesDistribution -> Rep InstancesDistribution x
Prelude.Generic)
newInstancesDistribution ::
InstancesDistribution
newInstancesDistribution :: InstancesDistribution
newInstancesDistribution =
InstancesDistribution' :: Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> InstancesDistribution
InstancesDistribution'
{ $sel:spotAllocationStrategy:InstancesDistribution' :: Maybe Text
spotAllocationStrategy =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:spotInstancePools:InstancesDistribution' :: Maybe Int
spotInstancePools = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:spotMaxPrice:InstancesDistribution' :: Maybe Text
spotMaxPrice = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:onDemandBaseCapacity:InstancesDistribution' :: Maybe Int
onDemandBaseCapacity = Maybe Int
forall a. Maybe a
Prelude.Nothing,
$sel:onDemandAllocationStrategy:InstancesDistribution' :: Maybe Text
onDemandAllocationStrategy = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:onDemandPercentageAboveBaseCapacity:InstancesDistribution' :: Maybe Int
onDemandPercentageAboveBaseCapacity =
Maybe Int
forall a. Maybe a
Prelude.Nothing
}
instancesDistribution_spotAllocationStrategy :: Lens.Lens' InstancesDistribution (Prelude.Maybe Prelude.Text)
instancesDistribution_spotAllocationStrategy :: (Maybe Text -> f (Maybe Text))
-> InstancesDistribution -> f InstancesDistribution
instancesDistribution_spotAllocationStrategy = (InstancesDistribution -> Maybe Text)
-> (InstancesDistribution -> Maybe Text -> InstancesDistribution)
-> Lens
InstancesDistribution
InstancesDistribution
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancesDistribution' {Maybe Text
spotAllocationStrategy :: Maybe Text
$sel:spotAllocationStrategy:InstancesDistribution' :: InstancesDistribution -> Maybe Text
spotAllocationStrategy} -> Maybe Text
spotAllocationStrategy) (\s :: InstancesDistribution
s@InstancesDistribution' {} Maybe Text
a -> InstancesDistribution
s {$sel:spotAllocationStrategy:InstancesDistribution' :: Maybe Text
spotAllocationStrategy = Maybe Text
a} :: InstancesDistribution)
instancesDistribution_spotInstancePools :: Lens.Lens' InstancesDistribution (Prelude.Maybe Prelude.Int)
instancesDistribution_spotInstancePools :: (Maybe Int -> f (Maybe Int))
-> InstancesDistribution -> f InstancesDistribution
instancesDistribution_spotInstancePools = (InstancesDistribution -> Maybe Int)
-> (InstancesDistribution -> Maybe Int -> InstancesDistribution)
-> Lens
InstancesDistribution InstancesDistribution (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancesDistribution' {Maybe Int
spotInstancePools :: Maybe Int
$sel:spotInstancePools:InstancesDistribution' :: InstancesDistribution -> Maybe Int
spotInstancePools} -> Maybe Int
spotInstancePools) (\s :: InstancesDistribution
s@InstancesDistribution' {} Maybe Int
a -> InstancesDistribution
s {$sel:spotInstancePools:InstancesDistribution' :: Maybe Int
spotInstancePools = Maybe Int
a} :: InstancesDistribution)
instancesDistribution_spotMaxPrice :: Lens.Lens' InstancesDistribution (Prelude.Maybe Prelude.Text)
instancesDistribution_spotMaxPrice :: (Maybe Text -> f (Maybe Text))
-> InstancesDistribution -> f InstancesDistribution
instancesDistribution_spotMaxPrice = (InstancesDistribution -> Maybe Text)
-> (InstancesDistribution -> Maybe Text -> InstancesDistribution)
-> Lens
InstancesDistribution
InstancesDistribution
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancesDistribution' {Maybe Text
spotMaxPrice :: Maybe Text
$sel:spotMaxPrice:InstancesDistribution' :: InstancesDistribution -> Maybe Text
spotMaxPrice} -> Maybe Text
spotMaxPrice) (\s :: InstancesDistribution
s@InstancesDistribution' {} Maybe Text
a -> InstancesDistribution
s {$sel:spotMaxPrice:InstancesDistribution' :: Maybe Text
spotMaxPrice = Maybe Text
a} :: InstancesDistribution)
instancesDistribution_onDemandBaseCapacity :: Lens.Lens' InstancesDistribution (Prelude.Maybe Prelude.Int)
instancesDistribution_onDemandBaseCapacity :: (Maybe Int -> f (Maybe Int))
-> InstancesDistribution -> f InstancesDistribution
instancesDistribution_onDemandBaseCapacity = (InstancesDistribution -> Maybe Int)
-> (InstancesDistribution -> Maybe Int -> InstancesDistribution)
-> Lens
InstancesDistribution InstancesDistribution (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancesDistribution' {Maybe Int
onDemandBaseCapacity :: Maybe Int
$sel:onDemandBaseCapacity:InstancesDistribution' :: InstancesDistribution -> Maybe Int
onDemandBaseCapacity} -> Maybe Int
onDemandBaseCapacity) (\s :: InstancesDistribution
s@InstancesDistribution' {} Maybe Int
a -> InstancesDistribution
s {$sel:onDemandBaseCapacity:InstancesDistribution' :: Maybe Int
onDemandBaseCapacity = Maybe Int
a} :: InstancesDistribution)
instancesDistribution_onDemandAllocationStrategy :: Lens.Lens' InstancesDistribution (Prelude.Maybe Prelude.Text)
instancesDistribution_onDemandAllocationStrategy :: (Maybe Text -> f (Maybe Text))
-> InstancesDistribution -> f InstancesDistribution
instancesDistribution_onDemandAllocationStrategy = (InstancesDistribution -> Maybe Text)
-> (InstancesDistribution -> Maybe Text -> InstancesDistribution)
-> Lens
InstancesDistribution
InstancesDistribution
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancesDistribution' {Maybe Text
onDemandAllocationStrategy :: Maybe Text
$sel:onDemandAllocationStrategy:InstancesDistribution' :: InstancesDistribution -> Maybe Text
onDemandAllocationStrategy} -> Maybe Text
onDemandAllocationStrategy) (\s :: InstancesDistribution
s@InstancesDistribution' {} Maybe Text
a -> InstancesDistribution
s {$sel:onDemandAllocationStrategy:InstancesDistribution' :: Maybe Text
onDemandAllocationStrategy = Maybe Text
a} :: InstancesDistribution)
instancesDistribution_onDemandPercentageAboveBaseCapacity :: Lens.Lens' InstancesDistribution (Prelude.Maybe Prelude.Int)
instancesDistribution_onDemandPercentageAboveBaseCapacity :: (Maybe Int -> f (Maybe Int))
-> InstancesDistribution -> f InstancesDistribution
instancesDistribution_onDemandPercentageAboveBaseCapacity = (InstancesDistribution -> Maybe Int)
-> (InstancesDistribution -> Maybe Int -> InstancesDistribution)
-> Lens
InstancesDistribution InstancesDistribution (Maybe Int) (Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InstancesDistribution' {Maybe Int
onDemandPercentageAboveBaseCapacity :: Maybe Int
$sel:onDemandPercentageAboveBaseCapacity:InstancesDistribution' :: InstancesDistribution -> Maybe Int
onDemandPercentageAboveBaseCapacity} -> Maybe Int
onDemandPercentageAboveBaseCapacity) (\s :: InstancesDistribution
s@InstancesDistribution' {} Maybe Int
a -> InstancesDistribution
s {$sel:onDemandPercentageAboveBaseCapacity:InstancesDistribution' :: Maybe Int
onDemandPercentageAboveBaseCapacity = Maybe Int
a} :: InstancesDistribution)
instance Core.FromXML InstancesDistribution where
parseXML :: [Node] -> Either String InstancesDistribution
parseXML [Node]
x =
Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> InstancesDistribution
InstancesDistribution'
(Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> InstancesDistribution)
-> Either String (Maybe Text)
-> Either
String
(Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> InstancesDistribution)
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
"SpotAllocationStrategy")
Either
String
(Maybe Int
-> Maybe Text
-> Maybe Int
-> Maybe Text
-> Maybe Int
-> InstancesDistribution)
-> Either String (Maybe Int)
-> Either
String
(Maybe Text
-> Maybe Int -> Maybe Text -> Maybe Int -> InstancesDistribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"SpotInstancePools")
Either
String
(Maybe Text
-> Maybe Int -> Maybe Text -> Maybe Int -> InstancesDistribution)
-> Either String (Maybe Text)
-> Either
String
(Maybe Int -> Maybe Text -> Maybe Int -> InstancesDistribution)
forall (f :: * -> *) a b. Applicative f => 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
"SpotMaxPrice")
Either
String
(Maybe Int -> Maybe Text -> Maybe Int -> InstancesDistribution)
-> Either String (Maybe Int)
-> Either String (Maybe Text -> Maybe Int -> InstancesDistribution)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"OnDemandBaseCapacity")
Either String (Maybe Text -> Maybe Int -> InstancesDistribution)
-> Either String (Maybe Text)
-> Either String (Maybe Int -> InstancesDistribution)
forall (f :: * -> *) a b. Applicative f => 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
"OnDemandAllocationStrategy")
Either String (Maybe Int -> InstancesDistribution)
-> Either String (Maybe Int) -> Either String InstancesDistribution
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ([Node]
x [Node] -> Text -> Either String (Maybe Int)
forall a. FromXML a => [Node] -> Text -> Either String (Maybe a)
Core..@? Text
"OnDemandPercentageAboveBaseCapacity")
instance Prelude.Hashable InstancesDistribution
instance Prelude.NFData InstancesDistribution
instance Core.ToQuery InstancesDistribution where
toQuery :: InstancesDistribution -> QueryString
toQuery InstancesDistribution' {Maybe Int
Maybe Text
onDemandPercentageAboveBaseCapacity :: Maybe Int
onDemandAllocationStrategy :: Maybe Text
onDemandBaseCapacity :: Maybe Int
spotMaxPrice :: Maybe Text
spotInstancePools :: Maybe Int
spotAllocationStrategy :: Maybe Text
$sel:onDemandPercentageAboveBaseCapacity:InstancesDistribution' :: InstancesDistribution -> Maybe Int
$sel:onDemandAllocationStrategy:InstancesDistribution' :: InstancesDistribution -> Maybe Text
$sel:onDemandBaseCapacity:InstancesDistribution' :: InstancesDistribution -> Maybe Int
$sel:spotMaxPrice:InstancesDistribution' :: InstancesDistribution -> Maybe Text
$sel:spotInstancePools:InstancesDistribution' :: InstancesDistribution -> Maybe Int
$sel:spotAllocationStrategy:InstancesDistribution' :: InstancesDistribution -> Maybe Text
..} =
[QueryString] -> QueryString
forall a. Monoid a => [a] -> a
Prelude.mconcat
[ ByteString
"SpotAllocationStrategy"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
spotAllocationStrategy,
ByteString
"SpotInstancePools" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
spotInstancePools,
ByteString
"SpotMaxPrice" ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
spotMaxPrice,
ByteString
"OnDemandBaseCapacity" ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
onDemandBaseCapacity,
ByteString
"OnDemandAllocationStrategy"
ByteString -> Maybe Text -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Text
onDemandAllocationStrategy,
ByteString
"OnDemandPercentageAboveBaseCapacity"
ByteString -> Maybe Int -> QueryString
forall a. ToQuery a => ByteString -> a -> QueryString
Core.=: Maybe Int
onDemandPercentageAboveBaseCapacity
]