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