{-# 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.EndTimeRange where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data EndTimeRange = EndTimeRange'
{
EndTimeRange -> Maybe POSIX
fromTime :: Prelude.Maybe Core.POSIX,
EndTimeRange -> Maybe POSIX
toTime :: Prelude.Maybe Core.POSIX
}
deriving (EndTimeRange -> EndTimeRange -> Bool
(EndTimeRange -> EndTimeRange -> Bool)
-> (EndTimeRange -> EndTimeRange -> Bool) -> Eq EndTimeRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: EndTimeRange -> EndTimeRange -> Bool
$c/= :: EndTimeRange -> EndTimeRange -> Bool
== :: EndTimeRange -> EndTimeRange -> Bool
$c== :: EndTimeRange -> EndTimeRange -> Bool
Prelude.Eq, ReadPrec [EndTimeRange]
ReadPrec EndTimeRange
Int -> ReadS EndTimeRange
ReadS [EndTimeRange]
(Int -> ReadS EndTimeRange)
-> ReadS [EndTimeRange]
-> ReadPrec EndTimeRange
-> ReadPrec [EndTimeRange]
-> Read EndTimeRange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [EndTimeRange]
$creadListPrec :: ReadPrec [EndTimeRange]
readPrec :: ReadPrec EndTimeRange
$creadPrec :: ReadPrec EndTimeRange
readList :: ReadS [EndTimeRange]
$creadList :: ReadS [EndTimeRange]
readsPrec :: Int -> ReadS EndTimeRange
$creadsPrec :: Int -> ReadS EndTimeRange
Prelude.Read, Int -> EndTimeRange -> ShowS
[EndTimeRange] -> ShowS
EndTimeRange -> String
(Int -> EndTimeRange -> ShowS)
-> (EndTimeRange -> String)
-> ([EndTimeRange] -> ShowS)
-> Show EndTimeRange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [EndTimeRange] -> ShowS
$cshowList :: [EndTimeRange] -> ShowS
show :: EndTimeRange -> String
$cshow :: EndTimeRange -> String
showsPrec :: Int -> EndTimeRange -> ShowS
$cshowsPrec :: Int -> EndTimeRange -> ShowS
Prelude.Show, (forall x. EndTimeRange -> Rep EndTimeRange x)
-> (forall x. Rep EndTimeRange x -> EndTimeRange)
-> Generic EndTimeRange
forall x. Rep EndTimeRange x -> EndTimeRange
forall x. EndTimeRange -> Rep EndTimeRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep EndTimeRange x -> EndTimeRange
$cfrom :: forall x. EndTimeRange -> Rep EndTimeRange x
Prelude.Generic)
newEndTimeRange ::
EndTimeRange
newEndTimeRange :: EndTimeRange
newEndTimeRange =
EndTimeRange' :: Maybe POSIX -> Maybe POSIX -> EndTimeRange
EndTimeRange'
{ $sel:fromTime:EndTimeRange' :: Maybe POSIX
fromTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:toTime:EndTimeRange' :: Maybe POSIX
toTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
endTimeRange_fromTime :: Lens.Lens' EndTimeRange (Prelude.Maybe Prelude.UTCTime)
endTimeRange_fromTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EndTimeRange -> f EndTimeRange
endTimeRange_fromTime = (EndTimeRange -> Maybe POSIX)
-> (EndTimeRange -> Maybe POSIX -> EndTimeRange)
-> Lens EndTimeRange EndTimeRange (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndTimeRange' {Maybe POSIX
fromTime :: Maybe POSIX
$sel:fromTime:EndTimeRange' :: EndTimeRange -> Maybe POSIX
fromTime} -> Maybe POSIX
fromTime) (\s :: EndTimeRange
s@EndTimeRange' {} Maybe POSIX
a -> EndTimeRange
s {$sel:fromTime:EndTimeRange' :: Maybe POSIX
fromTime = Maybe POSIX
a} :: EndTimeRange) ((Maybe POSIX -> f (Maybe POSIX))
-> EndTimeRange -> f EndTimeRange)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EndTimeRange
-> f EndTimeRange
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
endTimeRange_toTime :: Lens.Lens' EndTimeRange (Prelude.Maybe Prelude.UTCTime)
endTimeRange_toTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> EndTimeRange -> f EndTimeRange
endTimeRange_toTime = (EndTimeRange -> Maybe POSIX)
-> (EndTimeRange -> Maybe POSIX -> EndTimeRange)
-> Lens EndTimeRange EndTimeRange (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\EndTimeRange' {Maybe POSIX
toTime :: Maybe POSIX
$sel:toTime:EndTimeRange' :: EndTimeRange -> Maybe POSIX
toTime} -> Maybe POSIX
toTime) (\s :: EndTimeRange
s@EndTimeRange' {} Maybe POSIX
a -> EndTimeRange
s {$sel:toTime:EndTimeRange' :: Maybe POSIX
toTime = Maybe POSIX
a} :: EndTimeRange) ((Maybe POSIX -> f (Maybe POSIX))
-> EndTimeRange -> f EndTimeRange)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> EndTimeRange
-> f EndTimeRange
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso POSIX POSIX UTCTime UTCTime
-> Iso (Maybe POSIX) (Maybe POSIX) (Maybe UTCTime) (Maybe UTCTime)
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso POSIX POSIX UTCTime UTCTime
forall (a :: Format). Iso' (Time a) UTCTime
Core._Time
instance Prelude.Hashable EndTimeRange
instance Prelude.NFData EndTimeRange
instance Core.ToJSON EndTimeRange where
toJSON :: EndTimeRange -> Value
toJSON EndTimeRange' {Maybe POSIX
toTime :: Maybe POSIX
fromTime :: Maybe POSIX
$sel:toTime:EndTimeRange' :: EndTimeRange -> Maybe POSIX
$sel:fromTime:EndTimeRange' :: EndTimeRange -> Maybe POSIX
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"FromTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
fromTime,
(Text
"ToTime" Text -> POSIX -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (POSIX -> Pair) -> Maybe POSIX -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe POSIX
toTime
]
)