{-# 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.IoTEventsData.Types.SnoozeActionConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data SnoozeActionConfiguration = SnoozeActionConfiguration'
{
SnoozeActionConfiguration -> Maybe Text
note :: Prelude.Maybe Prelude.Text,
SnoozeActionConfiguration -> Maybe Int
snoozeDuration :: Prelude.Maybe Prelude.Int
}
deriving (SnoozeActionConfiguration -> SnoozeActionConfiguration -> Bool
(SnoozeActionConfiguration -> SnoozeActionConfiguration -> Bool)
-> (SnoozeActionConfiguration -> SnoozeActionConfiguration -> Bool)
-> Eq SnoozeActionConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SnoozeActionConfiguration -> SnoozeActionConfiguration -> Bool
$c/= :: SnoozeActionConfiguration -> SnoozeActionConfiguration -> Bool
== :: SnoozeActionConfiguration -> SnoozeActionConfiguration -> Bool
$c== :: SnoozeActionConfiguration -> SnoozeActionConfiguration -> Bool
Prelude.Eq, ReadPrec [SnoozeActionConfiguration]
ReadPrec SnoozeActionConfiguration
Int -> ReadS SnoozeActionConfiguration
ReadS [SnoozeActionConfiguration]
(Int -> ReadS SnoozeActionConfiguration)
-> ReadS [SnoozeActionConfiguration]
-> ReadPrec SnoozeActionConfiguration
-> ReadPrec [SnoozeActionConfiguration]
-> Read SnoozeActionConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SnoozeActionConfiguration]
$creadListPrec :: ReadPrec [SnoozeActionConfiguration]
readPrec :: ReadPrec SnoozeActionConfiguration
$creadPrec :: ReadPrec SnoozeActionConfiguration
readList :: ReadS [SnoozeActionConfiguration]
$creadList :: ReadS [SnoozeActionConfiguration]
readsPrec :: Int -> ReadS SnoozeActionConfiguration
$creadsPrec :: Int -> ReadS SnoozeActionConfiguration
Prelude.Read, Int -> SnoozeActionConfiguration -> ShowS
[SnoozeActionConfiguration] -> ShowS
SnoozeActionConfiguration -> String
(Int -> SnoozeActionConfiguration -> ShowS)
-> (SnoozeActionConfiguration -> String)
-> ([SnoozeActionConfiguration] -> ShowS)
-> Show SnoozeActionConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SnoozeActionConfiguration] -> ShowS
$cshowList :: [SnoozeActionConfiguration] -> ShowS
show :: SnoozeActionConfiguration -> String
$cshow :: SnoozeActionConfiguration -> String
showsPrec :: Int -> SnoozeActionConfiguration -> ShowS
$cshowsPrec :: Int -> SnoozeActionConfiguration -> ShowS
Prelude.Show, (forall x.
SnoozeActionConfiguration -> Rep SnoozeActionConfiguration x)
-> (forall x.
Rep SnoozeActionConfiguration x -> SnoozeActionConfiguration)
-> Generic SnoozeActionConfiguration
forall x.
Rep SnoozeActionConfiguration x -> SnoozeActionConfiguration
forall x.
SnoozeActionConfiguration -> Rep SnoozeActionConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep SnoozeActionConfiguration x -> SnoozeActionConfiguration
$cfrom :: forall x.
SnoozeActionConfiguration -> Rep SnoozeActionConfiguration x
Prelude.Generic)
newSnoozeActionConfiguration ::
SnoozeActionConfiguration
newSnoozeActionConfiguration :: SnoozeActionConfiguration
newSnoozeActionConfiguration =
SnoozeActionConfiguration' :: Maybe Text -> Maybe Int -> SnoozeActionConfiguration
SnoozeActionConfiguration'
{ $sel:note:SnoozeActionConfiguration' :: Maybe Text
note = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:snoozeDuration:SnoozeActionConfiguration' :: Maybe Int
snoozeDuration = Maybe Int
forall a. Maybe a
Prelude.Nothing
}
snoozeActionConfiguration_note :: Lens.Lens' SnoozeActionConfiguration (Prelude.Maybe Prelude.Text)
snoozeActionConfiguration_note :: (Maybe Text -> f (Maybe Text))
-> SnoozeActionConfiguration -> f SnoozeActionConfiguration
snoozeActionConfiguration_note = (SnoozeActionConfiguration -> Maybe Text)
-> (SnoozeActionConfiguration
-> Maybe Text -> SnoozeActionConfiguration)
-> Lens
SnoozeActionConfiguration
SnoozeActionConfiguration
(Maybe Text)
(Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnoozeActionConfiguration' {Maybe Text
note :: Maybe Text
$sel:note:SnoozeActionConfiguration' :: SnoozeActionConfiguration -> Maybe Text
note} -> Maybe Text
note) (\s :: SnoozeActionConfiguration
s@SnoozeActionConfiguration' {} Maybe Text
a -> SnoozeActionConfiguration
s {$sel:note:SnoozeActionConfiguration' :: Maybe Text
note = Maybe Text
a} :: SnoozeActionConfiguration)
snoozeActionConfiguration_snoozeDuration :: Lens.Lens' SnoozeActionConfiguration (Prelude.Maybe Prelude.Int)
snoozeActionConfiguration_snoozeDuration :: (Maybe Int -> f (Maybe Int))
-> SnoozeActionConfiguration -> f SnoozeActionConfiguration
snoozeActionConfiguration_snoozeDuration = (SnoozeActionConfiguration -> Maybe Int)
-> (SnoozeActionConfiguration
-> Maybe Int -> SnoozeActionConfiguration)
-> Lens
SnoozeActionConfiguration
SnoozeActionConfiguration
(Maybe Int)
(Maybe Int)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SnoozeActionConfiguration' {Maybe Int
snoozeDuration :: Maybe Int
$sel:snoozeDuration:SnoozeActionConfiguration' :: SnoozeActionConfiguration -> Maybe Int
snoozeDuration} -> Maybe Int
snoozeDuration) (\s :: SnoozeActionConfiguration
s@SnoozeActionConfiguration' {} Maybe Int
a -> SnoozeActionConfiguration
s {$sel:snoozeDuration:SnoozeActionConfiguration' :: Maybe Int
snoozeDuration = Maybe Int
a} :: SnoozeActionConfiguration)
instance Core.FromJSON SnoozeActionConfiguration where
parseJSON :: Value -> Parser SnoozeActionConfiguration
parseJSON =
String
-> (Object -> Parser SnoozeActionConfiguration)
-> Value
-> Parser SnoozeActionConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"SnoozeActionConfiguration"
( \Object
x ->
Maybe Text -> Maybe Int -> SnoozeActionConfiguration
SnoozeActionConfiguration'
(Maybe Text -> Maybe Int -> SnoozeActionConfiguration)
-> Parser (Maybe Text)
-> Parser (Maybe Int -> SnoozeActionConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"note")
Parser (Maybe Int -> SnoozeActionConfiguration)
-> Parser (Maybe Int) -> Parser SnoozeActionConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Int)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"snoozeDuration")
)
instance Prelude.Hashable SnoozeActionConfiguration
instance Prelude.NFData SnoozeActionConfiguration