{-# 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.DevOpsGuru.Types.EventTimeRange where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EventTimeRange = EventTimeRange'
{
EventTimeRange -> POSIX
fromTime :: Core.POSIX,
EventTimeRange -> POSIX
toTime :: Core.POSIX
}
deriving (EventTimeRange -> EventTimeRange -> Bool
(EventTimeRange -> EventTimeRange -> Bool)
-> (EventTimeRange -> EventTimeRange -> Bool) -> Eq EventTimeRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EventTimeRange -> EventTimeRange -> Bool
$c/= :: EventTimeRange -> EventTimeRange -> Bool
== :: EventTimeRange -> EventTimeRange -> Bool
$c== :: EventTimeRange -> EventTimeRange -> Bool
Prelude.Eq, ReadPrec [EventTimeRange]
ReadPrec EventTimeRange
Int -> ReadS EventTimeRange
ReadS [EventTimeRange]
(Int -> ReadS EventTimeRange)
-> ReadS [EventTimeRange]
-> ReadPrec EventTimeRange
-> ReadPrec [EventTimeRange]
-> Read EventTimeRange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EventTimeRange]
$creadListPrec :: ReadPrec [EventTimeRange]
readPrec :: ReadPrec EventTimeRange
$creadPrec :: ReadPrec EventTimeRange
readList :: ReadS [EventTimeRange]
$creadList :: ReadS [EventTimeRange]
readsPrec :: Int -> ReadS EventTimeRange
$creadsPrec :: Int -> ReadS EventTimeRange
Prelude.Read, Int -> EventTimeRange -> ShowS
[EventTimeRange] -> ShowS
EventTimeRange -> String
(Int -> EventTimeRange -> ShowS)
-> (EventTimeRange -> String)
-> ([EventTimeRange] -> ShowS)
-> Show EventTimeRange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EventTimeRange] -> ShowS
$cshowList :: [EventTimeRange] -> ShowS
show :: EventTimeRange -> String
$cshow :: EventTimeRange -> String
showsPrec :: Int -> EventTimeRange -> ShowS
$cshowsPrec :: Int -> EventTimeRange -> ShowS
Prelude.Show, (forall x. EventTimeRange -> Rep EventTimeRange x)
-> (forall x. Rep EventTimeRange x -> EventTimeRange)
-> Generic EventTimeRange
forall x. Rep EventTimeRange x -> EventTimeRange
forall x. EventTimeRange -> Rep EventTimeRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EventTimeRange x -> EventTimeRange
$cfrom :: forall x. EventTimeRange -> Rep EventTimeRange x
Prelude.Generic)
newEventTimeRange ::
Prelude.UTCTime ->
Prelude.UTCTime ->
EventTimeRange
newEventTimeRange :: UTCTime -> UTCTime -> EventTimeRange
newEventTimeRange UTCTime
pFromTime_ UTCTime
pToTime_ =
EventTimeRange' :: POSIX -> POSIX -> EventTimeRange
EventTimeRange'
{ $sel:fromTime:EventTimeRange' :: POSIX
fromTime =
Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pFromTime_,
$sel:toTime:EventTimeRange' :: POSIX
toTime = Tagged UTCTime (Identity UTCTime) -> Tagged POSIX (Identity POSIX)
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time (Tagged UTCTime (Identity UTCTime)
-> Tagged POSIX (Identity POSIX))
-> UTCTime -> POSIX
forall t b. AReview t b -> b -> t
Lens.# UTCTime
pToTime_
}
eventTimeRange_fromTime :: Lens.Lens' EventTimeRange Prelude.UTCTime
eventTimeRange_fromTime :: (UTCTime -> f UTCTime) -> EventTimeRange -> f EventTimeRange
eventTimeRange_fromTime = (EventTimeRange -> POSIX)
-> (EventTimeRange -> POSIX -> EventTimeRange)
-> Lens EventTimeRange EventTimeRange POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTimeRange' {POSIX
fromTime :: POSIX
$sel:fromTime:EventTimeRange' :: EventTimeRange -> POSIX
fromTime} -> POSIX
fromTime) (\s :: EventTimeRange
s@EventTimeRange' {} POSIX
a -> EventTimeRange
s {$sel:fromTime:EventTimeRange' :: POSIX
fromTime = POSIX
a} :: EventTimeRange) ((POSIX -> f POSIX) -> EventTimeRange -> f EventTimeRange)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> EventTimeRange
-> f EventTimeRange
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
eventTimeRange_toTime :: Lens.Lens' EventTimeRange Prelude.UTCTime
eventTimeRange_toTime :: (UTCTime -> f UTCTime) -> EventTimeRange -> f EventTimeRange
eventTimeRange_toTime = (EventTimeRange -> POSIX)
-> (EventTimeRange -> POSIX -> EventTimeRange)
-> Lens EventTimeRange EventTimeRange POSIX POSIX
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EventTimeRange' {POSIX
toTime :: POSIX
$sel:toTime:EventTimeRange' :: EventTimeRange -> POSIX
toTime} -> POSIX
toTime) (\s :: EventTimeRange
s@EventTimeRange' {} POSIX
a -> EventTimeRange
s {$sel:toTime:EventTimeRange' :: POSIX
toTime = POSIX
a} :: EventTimeRange) ((POSIX -> f POSIX) -> EventTimeRange -> f EventTimeRange)
-> ((UTCTime -> f UTCTime) -> POSIX -> f POSIX)
-> (UTCTime -> f UTCTime)
-> EventTimeRange
-> f EventTimeRange
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. (UTCTime -> f UTCTime) -> POSIX -> f POSIX
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Prelude.Hashable EventTimeRange
instance Prelude.NFData EventTimeRange
instance Core.ToJSON EventTimeRange where
toJSON :: EventTimeRange -> Value
toJSON EventTimeRange' {POSIX
toTime :: POSIX
fromTime :: POSIX
$sel:toTime:EventTimeRange' :: EventTimeRange -> POSIX
$sel:fromTime:EventTimeRange' :: EventTimeRange -> POSIX
..} =
[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
"FromTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
fromTime),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"ToTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= POSIX
toTime)
]
)