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