{-# 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.KinesisVideoArchivedMedia.Types.HLSTimestampRange where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data HLSTimestampRange = HLSTimestampRange'
{
HLSTimestampRange -> Maybe POSIX
endTimestamp :: Prelude.Maybe Core.POSIX,
HLSTimestampRange -> Maybe POSIX
startTimestamp :: Prelude.Maybe Core.POSIX
}
deriving (HLSTimestampRange -> HLSTimestampRange -> Bool
(HLSTimestampRange -> HLSTimestampRange -> Bool)
-> (HLSTimestampRange -> HLSTimestampRange -> Bool)
-> Eq HLSTimestampRange
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HLSTimestampRange -> HLSTimestampRange -> Bool
$c/= :: HLSTimestampRange -> HLSTimestampRange -> Bool
== :: HLSTimestampRange -> HLSTimestampRange -> Bool
$c== :: HLSTimestampRange -> HLSTimestampRange -> Bool
Prelude.Eq, ReadPrec [HLSTimestampRange]
ReadPrec HLSTimestampRange
Int -> ReadS HLSTimestampRange
ReadS [HLSTimestampRange]
(Int -> ReadS HLSTimestampRange)
-> ReadS [HLSTimestampRange]
-> ReadPrec HLSTimestampRange
-> ReadPrec [HLSTimestampRange]
-> Read HLSTimestampRange
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HLSTimestampRange]
$creadListPrec :: ReadPrec [HLSTimestampRange]
readPrec :: ReadPrec HLSTimestampRange
$creadPrec :: ReadPrec HLSTimestampRange
readList :: ReadS [HLSTimestampRange]
$creadList :: ReadS [HLSTimestampRange]
readsPrec :: Int -> ReadS HLSTimestampRange
$creadsPrec :: Int -> ReadS HLSTimestampRange
Prelude.Read, Int -> HLSTimestampRange -> ShowS
[HLSTimestampRange] -> ShowS
HLSTimestampRange -> String
(Int -> HLSTimestampRange -> ShowS)
-> (HLSTimestampRange -> String)
-> ([HLSTimestampRange] -> ShowS)
-> Show HLSTimestampRange
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HLSTimestampRange] -> ShowS
$cshowList :: [HLSTimestampRange] -> ShowS
show :: HLSTimestampRange -> String
$cshow :: HLSTimestampRange -> String
showsPrec :: Int -> HLSTimestampRange -> ShowS
$cshowsPrec :: Int -> HLSTimestampRange -> ShowS
Prelude.Show, (forall x. HLSTimestampRange -> Rep HLSTimestampRange x)
-> (forall x. Rep HLSTimestampRange x -> HLSTimestampRange)
-> Generic HLSTimestampRange
forall x. Rep HLSTimestampRange x -> HLSTimestampRange
forall x. HLSTimestampRange -> Rep HLSTimestampRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep HLSTimestampRange x -> HLSTimestampRange
$cfrom :: forall x. HLSTimestampRange -> Rep HLSTimestampRange x
Prelude.Generic)
newHLSTimestampRange ::
HLSTimestampRange
newHLSTimestampRange :: HLSTimestampRange
newHLSTimestampRange =
HLSTimestampRange' :: Maybe POSIX -> Maybe POSIX -> HLSTimestampRange
HLSTimestampRange'
{ $sel:endTimestamp:HLSTimestampRange' :: Maybe POSIX
endTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:startTimestamp:HLSTimestampRange' :: Maybe POSIX
startTimestamp = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
hLSTimestampRange_endTimestamp :: Lens.Lens' HLSTimestampRange (Prelude.Maybe Prelude.UTCTime)
hLSTimestampRange_endTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> HLSTimestampRange -> f HLSTimestampRange
hLSTimestampRange_endTimestamp = (HLSTimestampRange -> Maybe POSIX)
-> (HLSTimestampRange -> Maybe POSIX -> HLSTimestampRange)
-> Lens
HLSTimestampRange HLSTimestampRange (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HLSTimestampRange' {Maybe POSIX
endTimestamp :: Maybe POSIX
$sel:endTimestamp:HLSTimestampRange' :: HLSTimestampRange -> Maybe POSIX
endTimestamp} -> Maybe POSIX
endTimestamp) (\s :: HLSTimestampRange
s@HLSTimestampRange' {} Maybe POSIX
a -> HLSTimestampRange
s {$sel:endTimestamp:HLSTimestampRange' :: Maybe POSIX
endTimestamp = Maybe POSIX
a} :: HLSTimestampRange) ((Maybe POSIX -> f (Maybe POSIX))
-> HLSTimestampRange -> f HLSTimestampRange)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> HLSTimestampRange
-> f HLSTimestampRange
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
hLSTimestampRange_startTimestamp :: Lens.Lens' HLSTimestampRange (Prelude.Maybe Prelude.UTCTime)
hLSTimestampRange_startTimestamp :: (Maybe UTCTime -> f (Maybe UTCTime))
-> HLSTimestampRange -> f HLSTimestampRange
hLSTimestampRange_startTimestamp = (HLSTimestampRange -> Maybe POSIX)
-> (HLSTimestampRange -> Maybe POSIX -> HLSTimestampRange)
-> Lens
HLSTimestampRange HLSTimestampRange (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HLSTimestampRange' {Maybe POSIX
startTimestamp :: Maybe POSIX
$sel:startTimestamp:HLSTimestampRange' :: HLSTimestampRange -> Maybe POSIX
startTimestamp} -> Maybe POSIX
startTimestamp) (\s :: HLSTimestampRange
s@HLSTimestampRange' {} Maybe POSIX
a -> HLSTimestampRange
s {$sel:startTimestamp:HLSTimestampRange' :: Maybe POSIX
startTimestamp = Maybe POSIX
a} :: HLSTimestampRange) ((Maybe POSIX -> f (Maybe POSIX))
-> HLSTimestampRange -> f HLSTimestampRange)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> HLSTimestampRange
-> f HLSTimestampRange
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 HLSTimestampRange
instance Prelude.NFData HLSTimestampRange
instance Core.ToJSON HLSTimestampRange where
toJSON :: HLSTimestampRange -> Value
toJSON HLSTimestampRange' {Maybe POSIX
startTimestamp :: Maybe POSIX
endTimestamp :: Maybe POSIX
$sel:startTimestamp:HLSTimestampRange' :: HLSTimestampRange -> Maybe POSIX
$sel:endTimestamp:HLSTimestampRange' :: HLSTimestampRange -> Maybe POSIX
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"EndTimestamp" 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
endTimestamp,
(Text
"StartTimestamp" 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
startTimestamp
]
)