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