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