{-# 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.IoT.Types.AwsJobExponentialRolloutRate where
import qualified Amazonka.Core as Core
import Amazonka.IoT.Types.AwsJobRateIncreaseCriteria
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data AwsJobExponentialRolloutRate = AwsJobExponentialRolloutRate'
{
AwsJobExponentialRolloutRate -> Natural
baseRatePerMinute :: Prelude.Natural,
AwsJobExponentialRolloutRate -> Double
incrementFactor :: Prelude.Double,
AwsJobExponentialRolloutRate -> AwsJobRateIncreaseCriteria
rateIncreaseCriteria :: AwsJobRateIncreaseCriteria
}
deriving (AwsJobExponentialRolloutRate
-> AwsJobExponentialRolloutRate -> Bool
(AwsJobExponentialRolloutRate
-> AwsJobExponentialRolloutRate -> Bool)
-> (AwsJobExponentialRolloutRate
-> AwsJobExponentialRolloutRate -> Bool)
-> Eq AwsJobExponentialRolloutRate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AwsJobExponentialRolloutRate
-> AwsJobExponentialRolloutRate -> Bool
$c/= :: AwsJobExponentialRolloutRate
-> AwsJobExponentialRolloutRate -> Bool
== :: AwsJobExponentialRolloutRate
-> AwsJobExponentialRolloutRate -> Bool
$c== :: AwsJobExponentialRolloutRate
-> AwsJobExponentialRolloutRate -> Bool
Prelude.Eq, ReadPrec [AwsJobExponentialRolloutRate]
ReadPrec AwsJobExponentialRolloutRate
Int -> ReadS AwsJobExponentialRolloutRate
ReadS [AwsJobExponentialRolloutRate]
(Int -> ReadS AwsJobExponentialRolloutRate)
-> ReadS [AwsJobExponentialRolloutRate]
-> ReadPrec AwsJobExponentialRolloutRate
-> ReadPrec [AwsJobExponentialRolloutRate]
-> Read AwsJobExponentialRolloutRate
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AwsJobExponentialRolloutRate]
$creadListPrec :: ReadPrec [AwsJobExponentialRolloutRate]
readPrec :: ReadPrec AwsJobExponentialRolloutRate
$creadPrec :: ReadPrec AwsJobExponentialRolloutRate
readList :: ReadS [AwsJobExponentialRolloutRate]
$creadList :: ReadS [AwsJobExponentialRolloutRate]
readsPrec :: Int -> ReadS AwsJobExponentialRolloutRate
$creadsPrec :: Int -> ReadS AwsJobExponentialRolloutRate
Prelude.Read, Int -> AwsJobExponentialRolloutRate -> ShowS
[AwsJobExponentialRolloutRate] -> ShowS
AwsJobExponentialRolloutRate -> String
(Int -> AwsJobExponentialRolloutRate -> ShowS)
-> (AwsJobExponentialRolloutRate -> String)
-> ([AwsJobExponentialRolloutRate] -> ShowS)
-> Show AwsJobExponentialRolloutRate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AwsJobExponentialRolloutRate] -> ShowS
$cshowList :: [AwsJobExponentialRolloutRate] -> ShowS
show :: AwsJobExponentialRolloutRate -> String
$cshow :: AwsJobExponentialRolloutRate -> String
showsPrec :: Int -> AwsJobExponentialRolloutRate -> ShowS
$cshowsPrec :: Int -> AwsJobExponentialRolloutRate -> ShowS
Prelude.Show, (forall x.
AwsJobExponentialRolloutRate -> Rep AwsJobExponentialRolloutRate x)
-> (forall x.
Rep AwsJobExponentialRolloutRate x -> AwsJobExponentialRolloutRate)
-> Generic AwsJobExponentialRolloutRate
forall x.
Rep AwsJobExponentialRolloutRate x -> AwsJobExponentialRolloutRate
forall x.
AwsJobExponentialRolloutRate -> Rep AwsJobExponentialRolloutRate x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep AwsJobExponentialRolloutRate x -> AwsJobExponentialRolloutRate
$cfrom :: forall x.
AwsJobExponentialRolloutRate -> Rep AwsJobExponentialRolloutRate x
Prelude.Generic)
newAwsJobExponentialRolloutRate ::
Prelude.Natural ->
Prelude.Double ->
AwsJobRateIncreaseCriteria ->
AwsJobExponentialRolloutRate
newAwsJobExponentialRolloutRate :: Natural
-> Double
-> AwsJobRateIncreaseCriteria
-> AwsJobExponentialRolloutRate
newAwsJobExponentialRolloutRate
Natural
pBaseRatePerMinute_
Double
pIncrementFactor_
AwsJobRateIncreaseCriteria
pRateIncreaseCriteria_ =
AwsJobExponentialRolloutRate' :: Natural
-> Double
-> AwsJobRateIncreaseCriteria
-> AwsJobExponentialRolloutRate
AwsJobExponentialRolloutRate'
{ $sel:baseRatePerMinute:AwsJobExponentialRolloutRate' :: Natural
baseRatePerMinute =
Natural
pBaseRatePerMinute_,
$sel:incrementFactor:AwsJobExponentialRolloutRate' :: Double
incrementFactor = Double
pIncrementFactor_,
$sel:rateIncreaseCriteria:AwsJobExponentialRolloutRate' :: AwsJobRateIncreaseCriteria
rateIncreaseCriteria = AwsJobRateIncreaseCriteria
pRateIncreaseCriteria_
}
awsJobExponentialRolloutRate_baseRatePerMinute :: Lens.Lens' AwsJobExponentialRolloutRate Prelude.Natural
awsJobExponentialRolloutRate_baseRatePerMinute :: (Natural -> f Natural)
-> AwsJobExponentialRolloutRate -> f AwsJobExponentialRolloutRate
awsJobExponentialRolloutRate_baseRatePerMinute = (AwsJobExponentialRolloutRate -> Natural)
-> (AwsJobExponentialRolloutRate
-> Natural -> AwsJobExponentialRolloutRate)
-> Lens
AwsJobExponentialRolloutRate
AwsJobExponentialRolloutRate
Natural
Natural
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsJobExponentialRolloutRate' {Natural
baseRatePerMinute :: Natural
$sel:baseRatePerMinute:AwsJobExponentialRolloutRate' :: AwsJobExponentialRolloutRate -> Natural
baseRatePerMinute} -> Natural
baseRatePerMinute) (\s :: AwsJobExponentialRolloutRate
s@AwsJobExponentialRolloutRate' {} Natural
a -> AwsJobExponentialRolloutRate
s {$sel:baseRatePerMinute:AwsJobExponentialRolloutRate' :: Natural
baseRatePerMinute = Natural
a} :: AwsJobExponentialRolloutRate)
awsJobExponentialRolloutRate_incrementFactor :: Lens.Lens' AwsJobExponentialRolloutRate Prelude.Double
awsJobExponentialRolloutRate_incrementFactor :: (Double -> f Double)
-> AwsJobExponentialRolloutRate -> f AwsJobExponentialRolloutRate
awsJobExponentialRolloutRate_incrementFactor = (AwsJobExponentialRolloutRate -> Double)
-> (AwsJobExponentialRolloutRate
-> Double -> AwsJobExponentialRolloutRate)
-> Lens
AwsJobExponentialRolloutRate
AwsJobExponentialRolloutRate
Double
Double
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsJobExponentialRolloutRate' {Double
incrementFactor :: Double
$sel:incrementFactor:AwsJobExponentialRolloutRate' :: AwsJobExponentialRolloutRate -> Double
incrementFactor} -> Double
incrementFactor) (\s :: AwsJobExponentialRolloutRate
s@AwsJobExponentialRolloutRate' {} Double
a -> AwsJobExponentialRolloutRate
s {$sel:incrementFactor:AwsJobExponentialRolloutRate' :: Double
incrementFactor = Double
a} :: AwsJobExponentialRolloutRate)
awsJobExponentialRolloutRate_rateIncreaseCriteria :: Lens.Lens' AwsJobExponentialRolloutRate AwsJobRateIncreaseCriteria
awsJobExponentialRolloutRate_rateIncreaseCriteria :: (AwsJobRateIncreaseCriteria -> f AwsJobRateIncreaseCriteria)
-> AwsJobExponentialRolloutRate -> f AwsJobExponentialRolloutRate
awsJobExponentialRolloutRate_rateIncreaseCriteria = (AwsJobExponentialRolloutRate -> AwsJobRateIncreaseCriteria)
-> (AwsJobExponentialRolloutRate
-> AwsJobRateIncreaseCriteria -> AwsJobExponentialRolloutRate)
-> Lens
AwsJobExponentialRolloutRate
AwsJobExponentialRolloutRate
AwsJobRateIncreaseCriteria
AwsJobRateIncreaseCriteria
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AwsJobExponentialRolloutRate' {AwsJobRateIncreaseCriteria
rateIncreaseCriteria :: AwsJobRateIncreaseCriteria
$sel:rateIncreaseCriteria:AwsJobExponentialRolloutRate' :: AwsJobExponentialRolloutRate -> AwsJobRateIncreaseCriteria
rateIncreaseCriteria} -> AwsJobRateIncreaseCriteria
rateIncreaseCriteria) (\s :: AwsJobExponentialRolloutRate
s@AwsJobExponentialRolloutRate' {} AwsJobRateIncreaseCriteria
a -> AwsJobExponentialRolloutRate
s {$sel:rateIncreaseCriteria:AwsJobExponentialRolloutRate' :: AwsJobRateIncreaseCriteria
rateIncreaseCriteria = AwsJobRateIncreaseCriteria
a} :: AwsJobExponentialRolloutRate)
instance Core.FromJSON AwsJobExponentialRolloutRate where
parseJSON :: Value -> Parser AwsJobExponentialRolloutRate
parseJSON =
String
-> (Object -> Parser AwsJobExponentialRolloutRate)
-> Value
-> Parser AwsJobExponentialRolloutRate
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"AwsJobExponentialRolloutRate"
( \Object
x ->
Natural
-> Double
-> AwsJobRateIncreaseCriteria
-> AwsJobExponentialRolloutRate
AwsJobExponentialRolloutRate'
(Natural
-> Double
-> AwsJobRateIncreaseCriteria
-> AwsJobExponentialRolloutRate)
-> Parser Natural
-> Parser
(Double
-> AwsJobRateIncreaseCriteria -> AwsJobExponentialRolloutRate)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Natural
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"baseRatePerMinute")
Parser
(Double
-> AwsJobRateIncreaseCriteria -> AwsJobExponentialRolloutRate)
-> Parser Double
-> Parser
(AwsJobRateIncreaseCriteria -> AwsJobExponentialRolloutRate)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Double
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"incrementFactor")
Parser (AwsJobRateIncreaseCriteria -> AwsJobExponentialRolloutRate)
-> Parser AwsJobRateIncreaseCriteria
-> Parser AwsJobExponentialRolloutRate
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser AwsJobRateIncreaseCriteria
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"rateIncreaseCriteria")
)
instance
Prelude.Hashable
AwsJobExponentialRolloutRate
instance Prelude.NFData AwsJobExponentialRolloutRate
instance Core.ToJSON AwsJobExponentialRolloutRate where
toJSON :: AwsJobExponentialRolloutRate -> Value
toJSON AwsJobExponentialRolloutRate' {Double
Natural
AwsJobRateIncreaseCriteria
rateIncreaseCriteria :: AwsJobRateIncreaseCriteria
incrementFactor :: Double
baseRatePerMinute :: Natural
$sel:rateIncreaseCriteria:AwsJobExponentialRolloutRate' :: AwsJobExponentialRolloutRate -> AwsJobRateIncreaseCriteria
$sel:incrementFactor:AwsJobExponentialRolloutRate' :: AwsJobExponentialRolloutRate -> Double
$sel:baseRatePerMinute:AwsJobExponentialRolloutRate' :: AwsJobExponentialRolloutRate -> Natural
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"baseRatePerMinute" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Natural
baseRatePerMinute),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
(Text
"incrementFactor" Text -> Double -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Double
incrementFactor),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
( Text
"rateIncreaseCriteria"
Text -> AwsJobRateIncreaseCriteria -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= AwsJobRateIncreaseCriteria
rateIncreaseCriteria
)
]
)