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