{-# 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.MediaLive.Types.StartTimecode 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 StartTimecode = StartTimecode'
{
StartTimecode -> Maybe Text
timecode :: Prelude.Maybe Prelude.Text
}
deriving (StartTimecode -> StartTimecode -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: StartTimecode -> StartTimecode -> Bool
$c/= :: StartTimecode -> StartTimecode -> Bool
== :: StartTimecode -> StartTimecode -> Bool
$c== :: StartTimecode -> StartTimecode -> Bool
Prelude.Eq, ReadPrec [StartTimecode]
ReadPrec StartTimecode
Int -> ReadS StartTimecode
ReadS [StartTimecode]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [StartTimecode]
$creadListPrec :: ReadPrec [StartTimecode]
readPrec :: ReadPrec StartTimecode
$creadPrec :: ReadPrec StartTimecode
readList :: ReadS [StartTimecode]
$creadList :: ReadS [StartTimecode]
readsPrec :: Int -> ReadS StartTimecode
$creadsPrec :: Int -> ReadS StartTimecode
Prelude.Read, Int -> StartTimecode -> ShowS
[StartTimecode] -> ShowS
StartTimecode -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [StartTimecode] -> ShowS
$cshowList :: [StartTimecode] -> ShowS
show :: StartTimecode -> String
$cshow :: StartTimecode -> String
showsPrec :: Int -> StartTimecode -> ShowS
$cshowsPrec :: Int -> StartTimecode -> ShowS
Prelude.Show, forall x. Rep StartTimecode x -> StartTimecode
forall x. StartTimecode -> Rep StartTimecode x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep StartTimecode x -> StartTimecode
$cfrom :: forall x. StartTimecode -> Rep StartTimecode x
Prelude.Generic)
newStartTimecode ::
StartTimecode
newStartTimecode :: StartTimecode
newStartTimecode =
StartTimecode' {$sel:timecode:StartTimecode' :: Maybe Text
timecode = forall a. Maybe a
Prelude.Nothing}
startTimecode_timecode :: Lens.Lens' StartTimecode (Prelude.Maybe Prelude.Text)
startTimecode_timecode :: Lens' StartTimecode (Maybe Text)
startTimecode_timecode = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\StartTimecode' {Maybe Text
timecode :: Maybe Text
$sel:timecode:StartTimecode' :: StartTimecode -> Maybe Text
timecode} -> Maybe Text
timecode) (\s :: StartTimecode
s@StartTimecode' {} Maybe Text
a -> StartTimecode
s {$sel:timecode:StartTimecode' :: Maybe Text
timecode = Maybe Text
a} :: StartTimecode)
instance Data.FromJSON StartTimecode where
parseJSON :: Value -> Parser StartTimecode
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"StartTimecode"
( \Object
x ->
Maybe Text -> StartTimecode
StartTimecode' 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
"timecode")
)
instance Prelude.Hashable StartTimecode where
hashWithSalt :: Int -> StartTimecode -> Int
hashWithSalt Int
_salt StartTimecode' {Maybe Text
timecode :: Maybe Text
$sel:timecode:StartTimecode' :: StartTimecode -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
timecode
instance Prelude.NFData StartTimecode where
rnf :: StartTimecode -> ()
rnf StartTimecode' {Maybe Text
timecode :: Maybe Text
$sel:timecode:StartTimecode' :: StartTimecode -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
timecode
instance Data.ToJSON StartTimecode where
toJSON :: StartTimecode -> Value
toJSON StartTimecode' {Maybe Text
timecode :: Maybe Text
$sel:timecode:StartTimecode' :: StartTimecode -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Key
"timecode" 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 Text
timecode]
)