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