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