{-# 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.Transcribe.Types.AbsoluteTimeRange where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data AbsoluteTimeRange = AbsoluteTimeRange'
{
AbsoluteTimeRange -> Maybe Natural
endTime :: Prelude.Maybe Prelude.Natural,
AbsoluteTimeRange -> Maybe Natural
first :: Prelude.Maybe Prelude.Natural,
AbsoluteTimeRange -> Maybe Natural
last :: Prelude.Maybe Prelude.Natural,
AbsoluteTimeRange -> Maybe Natural
startTime :: Prelude.Maybe Prelude.Natural
}
deriving (AbsoluteTimeRange -> AbsoluteTimeRange -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: AbsoluteTimeRange -> AbsoluteTimeRange -> Bool
$c/= :: AbsoluteTimeRange -> AbsoluteTimeRange -> Bool
== :: AbsoluteTimeRange -> AbsoluteTimeRange -> Bool
$c== :: AbsoluteTimeRange -> AbsoluteTimeRange -> Bool
Prelude.Eq, ReadPrec [AbsoluteTimeRange]
ReadPrec AbsoluteTimeRange
Int -> ReadS AbsoluteTimeRange
ReadS [AbsoluteTimeRange]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [AbsoluteTimeRange]
$creadListPrec :: ReadPrec [AbsoluteTimeRange]
readPrec :: ReadPrec AbsoluteTimeRange
$creadPrec :: ReadPrec AbsoluteTimeRange
readList :: ReadS [AbsoluteTimeRange]
$creadList :: ReadS [AbsoluteTimeRange]
readsPrec :: Int -> ReadS AbsoluteTimeRange
$creadsPrec :: Int -> ReadS AbsoluteTimeRange
Prelude.Read, Int -> AbsoluteTimeRange -> ShowS
[AbsoluteTimeRange] -> ShowS
AbsoluteTimeRange -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [AbsoluteTimeRange] -> ShowS
$cshowList :: [AbsoluteTimeRange] -> ShowS
show :: AbsoluteTimeRange -> String
$cshow :: AbsoluteTimeRange -> String
showsPrec :: Int -> AbsoluteTimeRange -> ShowS
$cshowsPrec :: Int -> AbsoluteTimeRange -> ShowS
Prelude.Show, forall x. Rep AbsoluteTimeRange x -> AbsoluteTimeRange
forall x. AbsoluteTimeRange -> Rep AbsoluteTimeRange x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep AbsoluteTimeRange x -> AbsoluteTimeRange
$cfrom :: forall x. AbsoluteTimeRange -> Rep AbsoluteTimeRange x
Prelude.Generic)
newAbsoluteTimeRange ::
AbsoluteTimeRange
newAbsoluteTimeRange :: AbsoluteTimeRange
newAbsoluteTimeRange =
AbsoluteTimeRange'
{ $sel:endTime:AbsoluteTimeRange' :: Maybe Natural
endTime = forall a. Maybe a
Prelude.Nothing,
$sel:first:AbsoluteTimeRange' :: Maybe Natural
first = forall a. Maybe a
Prelude.Nothing,
$sel:last:AbsoluteTimeRange' :: Maybe Natural
last = forall a. Maybe a
Prelude.Nothing,
$sel:startTime:AbsoluteTimeRange' :: Maybe Natural
startTime = forall a. Maybe a
Prelude.Nothing
}
absoluteTimeRange_endTime :: Lens.Lens' AbsoluteTimeRange (Prelude.Maybe Prelude.Natural)
absoluteTimeRange_endTime :: Lens' AbsoluteTimeRange (Maybe Natural)
absoluteTimeRange_endTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AbsoluteTimeRange' {Maybe Natural
endTime :: Maybe Natural
$sel:endTime:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
endTime} -> Maybe Natural
endTime) (\s :: AbsoluteTimeRange
s@AbsoluteTimeRange' {} Maybe Natural
a -> AbsoluteTimeRange
s {$sel:endTime:AbsoluteTimeRange' :: Maybe Natural
endTime = Maybe Natural
a} :: AbsoluteTimeRange)
absoluteTimeRange_first :: Lens.Lens' AbsoluteTimeRange (Prelude.Maybe Prelude.Natural)
absoluteTimeRange_first :: Lens' AbsoluteTimeRange (Maybe Natural)
absoluteTimeRange_first = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AbsoluteTimeRange' {Maybe Natural
first :: Maybe Natural
$sel:first:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
first} -> Maybe Natural
first) (\s :: AbsoluteTimeRange
s@AbsoluteTimeRange' {} Maybe Natural
a -> AbsoluteTimeRange
s {$sel:first:AbsoluteTimeRange' :: Maybe Natural
first = Maybe Natural
a} :: AbsoluteTimeRange)
absoluteTimeRange_last :: Lens.Lens' AbsoluteTimeRange (Prelude.Maybe Prelude.Natural)
absoluteTimeRange_last :: Lens' AbsoluteTimeRange (Maybe Natural)
absoluteTimeRange_last = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AbsoluteTimeRange' {Maybe Natural
last :: Maybe Natural
$sel:last:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
last} -> Maybe Natural
last) (\s :: AbsoluteTimeRange
s@AbsoluteTimeRange' {} Maybe Natural
a -> AbsoluteTimeRange
s {$sel:last:AbsoluteTimeRange' :: Maybe Natural
last = Maybe Natural
a} :: AbsoluteTimeRange)
absoluteTimeRange_startTime :: Lens.Lens' AbsoluteTimeRange (Prelude.Maybe Prelude.Natural)
absoluteTimeRange_startTime :: Lens' AbsoluteTimeRange (Maybe Natural)
absoluteTimeRange_startTime = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\AbsoluteTimeRange' {Maybe Natural
startTime :: Maybe Natural
$sel:startTime:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
startTime} -> Maybe Natural
startTime) (\s :: AbsoluteTimeRange
s@AbsoluteTimeRange' {} Maybe Natural
a -> AbsoluteTimeRange
s {$sel:startTime:AbsoluteTimeRange' :: Maybe Natural
startTime = Maybe Natural
a} :: AbsoluteTimeRange)
instance Data.FromJSON AbsoluteTimeRange where
parseJSON :: Value -> Parser AbsoluteTimeRange
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"AbsoluteTimeRange"
( \Object
x ->
Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> Maybe Natural
-> AbsoluteTimeRange
AbsoluteTimeRange'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"EndTime")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"First")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"Last")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"StartTime")
)
instance Prelude.Hashable AbsoluteTimeRange where
hashWithSalt :: Int -> AbsoluteTimeRange -> Int
hashWithSalt Int
_salt AbsoluteTimeRange' {Maybe Natural
startTime :: Maybe Natural
last :: Maybe Natural
first :: Maybe Natural
endTime :: Maybe Natural
$sel:startTime:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
$sel:last:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
$sel:first:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
$sel:endTime:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
endTime
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
first
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
last
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
startTime
instance Prelude.NFData AbsoluteTimeRange where
rnf :: AbsoluteTimeRange -> ()
rnf AbsoluteTimeRange' {Maybe Natural
startTime :: Maybe Natural
last :: Maybe Natural
first :: Maybe Natural
endTime :: Maybe Natural
$sel:startTime:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
$sel:last:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
$sel:first:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
$sel:endTime:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
endTime
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
first
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
last
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
startTime
instance Data.ToJSON AbsoluteTimeRange where
toJSON :: AbsoluteTimeRange -> Value
toJSON AbsoluteTimeRange' {Maybe Natural
startTime :: Maybe Natural
last :: Maybe Natural
first :: Maybe Natural
endTime :: Maybe Natural
$sel:startTime:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
$sel:last:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
$sel:first:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
$sel:endTime:AbsoluteTimeRange' :: AbsoluteTimeRange -> Maybe Natural
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"EndTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
endTime,
(Key
"First" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
first,
(Key
"Last" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
last,
(Key
"StartTime" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
startTime
]
)