{-# 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.ElasticTranscoder.Types.Clip where
import qualified Amazonka.Core as Core
import Amazonka.ElasticTranscoder.Types.TimeSpan
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data Clip = Clip'
{
Clip -> Maybe TimeSpan
timeSpan :: Prelude.Maybe TimeSpan
}
deriving (Clip -> Clip -> Bool
(Clip -> Clip -> Bool) -> (Clip -> Clip -> Bool) -> Eq Clip
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Clip -> Clip -> Bool
$c/= :: Clip -> Clip -> Bool
== :: Clip -> Clip -> Bool
$c== :: Clip -> Clip -> Bool
Prelude.Eq, ReadPrec [Clip]
ReadPrec Clip
Int -> ReadS Clip
ReadS [Clip]
(Int -> ReadS Clip)
-> ReadS [Clip] -> ReadPrec Clip -> ReadPrec [Clip] -> Read Clip
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Clip]
$creadListPrec :: ReadPrec [Clip]
readPrec :: ReadPrec Clip
$creadPrec :: ReadPrec Clip
readList :: ReadS [Clip]
$creadList :: ReadS [Clip]
readsPrec :: Int -> ReadS Clip
$creadsPrec :: Int -> ReadS Clip
Prelude.Read, Int -> Clip -> ShowS
[Clip] -> ShowS
Clip -> String
(Int -> Clip -> ShowS)
-> (Clip -> String) -> ([Clip] -> ShowS) -> Show Clip
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Clip] -> ShowS
$cshowList :: [Clip] -> ShowS
show :: Clip -> String
$cshow :: Clip -> String
showsPrec :: Int -> Clip -> ShowS
$cshowsPrec :: Int -> Clip -> ShowS
Prelude.Show, (forall x. Clip -> Rep Clip x)
-> (forall x. Rep Clip x -> Clip) -> Generic Clip
forall x. Rep Clip x -> Clip
forall x. Clip -> Rep Clip x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Clip x -> Clip
$cfrom :: forall x. Clip -> Rep Clip x
Prelude.Generic)
newClip ::
Clip
newClip :: Clip
newClip = Clip' :: Maybe TimeSpan -> Clip
Clip' {$sel:timeSpan:Clip' :: Maybe TimeSpan
timeSpan = Maybe TimeSpan
forall a. Maybe a
Prelude.Nothing}
clip_timeSpan :: Lens.Lens' Clip (Prelude.Maybe TimeSpan)
clip_timeSpan :: (Maybe TimeSpan -> f (Maybe TimeSpan)) -> Clip -> f Clip
clip_timeSpan = (Clip -> Maybe TimeSpan)
-> (Clip -> Maybe TimeSpan -> Clip)
-> Lens Clip Clip (Maybe TimeSpan) (Maybe TimeSpan)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Clip' {Maybe TimeSpan
timeSpan :: Maybe TimeSpan
$sel:timeSpan:Clip' :: Clip -> Maybe TimeSpan
timeSpan} -> Maybe TimeSpan
timeSpan) (\s :: Clip
s@Clip' {} Maybe TimeSpan
a -> Clip
s {$sel:timeSpan:Clip' :: Maybe TimeSpan
timeSpan = Maybe TimeSpan
a} :: Clip)
instance Core.FromJSON Clip where
parseJSON :: Value -> Parser Clip
parseJSON =
String -> (Object -> Parser Clip) -> Value -> Parser Clip
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Clip"
(\Object
x -> Maybe TimeSpan -> Clip
Clip' (Maybe TimeSpan -> Clip) -> Parser (Maybe TimeSpan) -> Parser Clip
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe TimeSpan)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"TimeSpan"))
instance Prelude.Hashable Clip
instance Prelude.NFData Clip
instance Core.ToJSON Clip where
toJSON :: Clip -> Value
toJSON Clip' {Maybe TimeSpan
timeSpan :: Maybe TimeSpan
$sel:timeSpan:Clip' :: Clip -> Maybe TimeSpan
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[(Text
"TimeSpan" Text -> TimeSpan -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (TimeSpan -> Pair) -> Maybe TimeSpan -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe TimeSpan
timeSpan]
)