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