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