{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ResetTimerAction = ResetTimerAction'
{
ResetTimerAction -> Text
timerName :: Prelude.Text
}
deriving (ResetTimerAction -> ResetTimerAction -> Bool
(ResetTimerAction -> ResetTimerAction -> Bool)
-> (ResetTimerAction -> ResetTimerAction -> Bool)
-> Eq ResetTimerAction
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]
(Int -> ReadS ResetTimerAction)
-> ReadS [ResetTimerAction]
-> ReadPrec ResetTimerAction
-> ReadPrec [ResetTimerAction]
-> Read 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
(Int -> ResetTimerAction -> ShowS)
-> (ResetTimerAction -> String)
-> ([ResetTimerAction] -> ShowS)
-> Show ResetTimerAction
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. ResetTimerAction -> Rep ResetTimerAction x)
-> (forall x. Rep ResetTimerAction x -> ResetTimerAction)
-> Generic ResetTimerAction
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' :: Text -> ResetTimerAction
ResetTimerAction' {$sel:timerName:ResetTimerAction' :: Text
timerName = Text
pTimerName_}
resetTimerAction_timerName :: Lens.Lens' ResetTimerAction Prelude.Text
resetTimerAction_timerName :: (Text -> f Text) -> ResetTimerAction -> f ResetTimerAction
resetTimerAction_timerName = (ResetTimerAction -> Text)
-> (ResetTimerAction -> Text -> ResetTimerAction)
-> Lens ResetTimerAction ResetTimerAction Text Text
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 Core.FromJSON ResetTimerAction where
parseJSON :: Value -> Parser ResetTimerAction
parseJSON =
String
-> (Object -> Parser ResetTimerAction)
-> Value
-> Parser ResetTimerAction
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ResetTimerAction"
( \Object
x ->
Text -> ResetTimerAction
ResetTimerAction'
(Text -> ResetTimerAction)
-> Parser Text -> Parser ResetTimerAction
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"timerName")
)
instance Prelude.Hashable ResetTimerAction
instance Prelude.NFData ResetTimerAction
instance Core.ToJSON ResetTimerAction where
toJSON :: ResetTimerAction -> Value
toJSON ResetTimerAction' {Text
timerName :: Text
$sel:timerName:ResetTimerAction' :: ResetTimerAction -> Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"timerName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
timerName)]
)