{-# 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.Pinpoint.Types.WaitTime 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 WaitTime = WaitTime'
{
WaitTime -> Maybe Text
waitFor :: Prelude.Maybe Prelude.Text,
WaitTime -> Maybe Text
waitUntil :: Prelude.Maybe Prelude.Text
}
deriving (WaitTime -> WaitTime -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: WaitTime -> WaitTime -> Bool
$c/= :: WaitTime -> WaitTime -> Bool
== :: WaitTime -> WaitTime -> Bool
$c== :: WaitTime -> WaitTime -> Bool
Prelude.Eq, ReadPrec [WaitTime]
ReadPrec WaitTime
Int -> ReadS WaitTime
ReadS [WaitTime]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [WaitTime]
$creadListPrec :: ReadPrec [WaitTime]
readPrec :: ReadPrec WaitTime
$creadPrec :: ReadPrec WaitTime
readList :: ReadS [WaitTime]
$creadList :: ReadS [WaitTime]
readsPrec :: Int -> ReadS WaitTime
$creadsPrec :: Int -> ReadS WaitTime
Prelude.Read, Int -> WaitTime -> ShowS
[WaitTime] -> ShowS
WaitTime -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [WaitTime] -> ShowS
$cshowList :: [WaitTime] -> ShowS
show :: WaitTime -> String
$cshow :: WaitTime -> String
showsPrec :: Int -> WaitTime -> ShowS
$cshowsPrec :: Int -> WaitTime -> ShowS
Prelude.Show, forall x. Rep WaitTime x -> WaitTime
forall x. WaitTime -> Rep WaitTime x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep WaitTime x -> WaitTime
$cfrom :: forall x. WaitTime -> Rep WaitTime x
Prelude.Generic)
newWaitTime ::
WaitTime
newWaitTime :: WaitTime
newWaitTime =
WaitTime'
{ $sel:waitFor:WaitTime' :: Maybe Text
waitFor = forall a. Maybe a
Prelude.Nothing,
$sel:waitUntil:WaitTime' :: Maybe Text
waitUntil = forall a. Maybe a
Prelude.Nothing
}
waitTime_waitFor :: Lens.Lens' WaitTime (Prelude.Maybe Prelude.Text)
waitTime_waitFor :: Lens' WaitTime (Maybe Text)
waitTime_waitFor = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WaitTime' {Maybe Text
waitFor :: Maybe Text
$sel:waitFor:WaitTime' :: WaitTime -> Maybe Text
waitFor} -> Maybe Text
waitFor) (\s :: WaitTime
s@WaitTime' {} Maybe Text
a -> WaitTime
s {$sel:waitFor:WaitTime' :: Maybe Text
waitFor = Maybe Text
a} :: WaitTime)
waitTime_waitUntil :: Lens.Lens' WaitTime (Prelude.Maybe Prelude.Text)
waitTime_waitUntil :: Lens' WaitTime (Maybe Text)
waitTime_waitUntil = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\WaitTime' {Maybe Text
waitUntil :: Maybe Text
$sel:waitUntil:WaitTime' :: WaitTime -> Maybe Text
waitUntil} -> Maybe Text
waitUntil) (\s :: WaitTime
s@WaitTime' {} Maybe Text
a -> WaitTime
s {$sel:waitUntil:WaitTime' :: Maybe Text
waitUntil = Maybe Text
a} :: WaitTime)
instance Data.FromJSON WaitTime where
parseJSON :: Value -> Parser WaitTime
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"WaitTime"
( \Object
x ->
Maybe Text -> Maybe Text -> WaitTime
WaitTime'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"WaitFor")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"WaitUntil")
)
instance Prelude.Hashable WaitTime where
hashWithSalt :: Int -> WaitTime -> Int
hashWithSalt Int
_salt WaitTime' {Maybe Text
waitUntil :: Maybe Text
waitFor :: Maybe Text
$sel:waitUntil:WaitTime' :: WaitTime -> Maybe Text
$sel:waitFor:WaitTime' :: WaitTime -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
waitFor
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
waitUntil
instance Prelude.NFData WaitTime where
rnf :: WaitTime -> ()
rnf WaitTime' {Maybe Text
waitUntil :: Maybe Text
waitFor :: Maybe Text
$sel:waitUntil:WaitTime' :: WaitTime -> Maybe Text
$sel:waitFor:WaitTime' :: WaitTime -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
waitFor
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
waitUntil
instance Data.ToJSON WaitTime where
toJSON :: WaitTime -> Value
toJSON WaitTime' {Maybe Text
waitUntil :: Maybe Text
waitFor :: Maybe Text
$sel:waitUntil:WaitTime' :: WaitTime -> Maybe Text
$sel:waitFor:WaitTime' :: WaitTime -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"WaitFor" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
waitFor,
(Key
"WaitUntil" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
waitUntil
]
)