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