{-# 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.MediaTailor.Types.ScheduleAdBreak where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data ScheduleAdBreak = ScheduleAdBreak'
{
ScheduleAdBreak -> Maybe Text
sourceLocationName :: Prelude.Maybe Prelude.Text,
ScheduleAdBreak -> Maybe Integer
approximateDurationSeconds :: Prelude.Maybe Prelude.Integer,
ScheduleAdBreak -> Maybe Text
vodSourceName :: Prelude.Maybe Prelude.Text,
ScheduleAdBreak -> Maybe POSIX
approximateStartTime :: Prelude.Maybe Core.POSIX
}
deriving (ScheduleAdBreak -> ScheduleAdBreak -> Bool
(ScheduleAdBreak -> ScheduleAdBreak -> Bool)
-> (ScheduleAdBreak -> ScheduleAdBreak -> Bool)
-> Eq ScheduleAdBreak
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScheduleAdBreak -> ScheduleAdBreak -> Bool
$c/= :: ScheduleAdBreak -> ScheduleAdBreak -> Bool
== :: ScheduleAdBreak -> ScheduleAdBreak -> Bool
$c== :: ScheduleAdBreak -> ScheduleAdBreak -> Bool
Prelude.Eq, ReadPrec [ScheduleAdBreak]
ReadPrec ScheduleAdBreak
Int -> ReadS ScheduleAdBreak
ReadS [ScheduleAdBreak]
(Int -> ReadS ScheduleAdBreak)
-> ReadS [ScheduleAdBreak]
-> ReadPrec ScheduleAdBreak
-> ReadPrec [ScheduleAdBreak]
-> Read ScheduleAdBreak
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScheduleAdBreak]
$creadListPrec :: ReadPrec [ScheduleAdBreak]
readPrec :: ReadPrec ScheduleAdBreak
$creadPrec :: ReadPrec ScheduleAdBreak
readList :: ReadS [ScheduleAdBreak]
$creadList :: ReadS [ScheduleAdBreak]
readsPrec :: Int -> ReadS ScheduleAdBreak
$creadsPrec :: Int -> ReadS ScheduleAdBreak
Prelude.Read, Int -> ScheduleAdBreak -> ShowS
[ScheduleAdBreak] -> ShowS
ScheduleAdBreak -> String
(Int -> ScheduleAdBreak -> ShowS)
-> (ScheduleAdBreak -> String)
-> ([ScheduleAdBreak] -> ShowS)
-> Show ScheduleAdBreak
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScheduleAdBreak] -> ShowS
$cshowList :: [ScheduleAdBreak] -> ShowS
show :: ScheduleAdBreak -> String
$cshow :: ScheduleAdBreak -> String
showsPrec :: Int -> ScheduleAdBreak -> ShowS
$cshowsPrec :: Int -> ScheduleAdBreak -> ShowS
Prelude.Show, (forall x. ScheduleAdBreak -> Rep ScheduleAdBreak x)
-> (forall x. Rep ScheduleAdBreak x -> ScheduleAdBreak)
-> Generic ScheduleAdBreak
forall x. Rep ScheduleAdBreak x -> ScheduleAdBreak
forall x. ScheduleAdBreak -> Rep ScheduleAdBreak x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScheduleAdBreak x -> ScheduleAdBreak
$cfrom :: forall x. ScheduleAdBreak -> Rep ScheduleAdBreak x
Prelude.Generic)
newScheduleAdBreak ::
ScheduleAdBreak
newScheduleAdBreak :: ScheduleAdBreak
newScheduleAdBreak =
ScheduleAdBreak' :: Maybe Text
-> Maybe Integer -> Maybe Text -> Maybe POSIX -> ScheduleAdBreak
ScheduleAdBreak'
{ $sel:sourceLocationName:ScheduleAdBreak' :: Maybe Text
sourceLocationName =
Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:approximateDurationSeconds:ScheduleAdBreak' :: Maybe Integer
approximateDurationSeconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:vodSourceName:ScheduleAdBreak' :: Maybe Text
vodSourceName = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:approximateStartTime:ScheduleAdBreak' :: Maybe POSIX
approximateStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing
}
scheduleAdBreak_sourceLocationName :: Lens.Lens' ScheduleAdBreak (Prelude.Maybe Prelude.Text)
scheduleAdBreak_sourceLocationName :: (Maybe Text -> f (Maybe Text))
-> ScheduleAdBreak -> f ScheduleAdBreak
scheduleAdBreak_sourceLocationName = (ScheduleAdBreak -> Maybe Text)
-> (ScheduleAdBreak -> Maybe Text -> ScheduleAdBreak)
-> Lens ScheduleAdBreak ScheduleAdBreak (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleAdBreak' {Maybe Text
sourceLocationName :: Maybe Text
$sel:sourceLocationName:ScheduleAdBreak' :: ScheduleAdBreak -> Maybe Text
sourceLocationName} -> Maybe Text
sourceLocationName) (\s :: ScheduleAdBreak
s@ScheduleAdBreak' {} Maybe Text
a -> ScheduleAdBreak
s {$sel:sourceLocationName:ScheduleAdBreak' :: Maybe Text
sourceLocationName = Maybe Text
a} :: ScheduleAdBreak)
scheduleAdBreak_approximateDurationSeconds :: Lens.Lens' ScheduleAdBreak (Prelude.Maybe Prelude.Integer)
scheduleAdBreak_approximateDurationSeconds :: (Maybe Integer -> f (Maybe Integer))
-> ScheduleAdBreak -> f ScheduleAdBreak
scheduleAdBreak_approximateDurationSeconds = (ScheduleAdBreak -> Maybe Integer)
-> (ScheduleAdBreak -> Maybe Integer -> ScheduleAdBreak)
-> Lens
ScheduleAdBreak ScheduleAdBreak (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleAdBreak' {Maybe Integer
approximateDurationSeconds :: Maybe Integer
$sel:approximateDurationSeconds:ScheduleAdBreak' :: ScheduleAdBreak -> Maybe Integer
approximateDurationSeconds} -> Maybe Integer
approximateDurationSeconds) (\s :: ScheduleAdBreak
s@ScheduleAdBreak' {} Maybe Integer
a -> ScheduleAdBreak
s {$sel:approximateDurationSeconds:ScheduleAdBreak' :: Maybe Integer
approximateDurationSeconds = Maybe Integer
a} :: ScheduleAdBreak)
scheduleAdBreak_vodSourceName :: Lens.Lens' ScheduleAdBreak (Prelude.Maybe Prelude.Text)
scheduleAdBreak_vodSourceName :: (Maybe Text -> f (Maybe Text))
-> ScheduleAdBreak -> f ScheduleAdBreak
scheduleAdBreak_vodSourceName = (ScheduleAdBreak -> Maybe Text)
-> (ScheduleAdBreak -> Maybe Text -> ScheduleAdBreak)
-> Lens ScheduleAdBreak ScheduleAdBreak (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleAdBreak' {Maybe Text
vodSourceName :: Maybe Text
$sel:vodSourceName:ScheduleAdBreak' :: ScheduleAdBreak -> Maybe Text
vodSourceName} -> Maybe Text
vodSourceName) (\s :: ScheduleAdBreak
s@ScheduleAdBreak' {} Maybe Text
a -> ScheduleAdBreak
s {$sel:vodSourceName:ScheduleAdBreak' :: Maybe Text
vodSourceName = Maybe Text
a} :: ScheduleAdBreak)
scheduleAdBreak_approximateStartTime :: Lens.Lens' ScheduleAdBreak (Prelude.Maybe Prelude.UTCTime)
scheduleAdBreak_approximateStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ScheduleAdBreak -> f ScheduleAdBreak
scheduleAdBreak_approximateStartTime = (ScheduleAdBreak -> Maybe POSIX)
-> (ScheduleAdBreak -> Maybe POSIX -> ScheduleAdBreak)
-> Lens ScheduleAdBreak ScheduleAdBreak (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleAdBreak' {Maybe POSIX
approximateStartTime :: Maybe POSIX
$sel:approximateStartTime:ScheduleAdBreak' :: ScheduleAdBreak -> Maybe POSIX
approximateStartTime} -> Maybe POSIX
approximateStartTime) (\s :: ScheduleAdBreak
s@ScheduleAdBreak' {} Maybe POSIX
a -> ScheduleAdBreak
s {$sel:approximateStartTime:ScheduleAdBreak' :: Maybe POSIX
approximateStartTime = Maybe POSIX
a} :: ScheduleAdBreak) ((Maybe POSIX -> f (Maybe POSIX))
-> ScheduleAdBreak -> f ScheduleAdBreak)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ScheduleAdBreak
-> f ScheduleAdBreak
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 Core.FromJSON ScheduleAdBreak where
parseJSON :: Value -> Parser ScheduleAdBreak
parseJSON =
String
-> (Object -> Parser ScheduleAdBreak)
-> Value
-> Parser ScheduleAdBreak
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ScheduleAdBreak"
( \Object
x ->
Maybe Text
-> Maybe Integer -> Maybe Text -> Maybe POSIX -> ScheduleAdBreak
ScheduleAdBreak'
(Maybe Text
-> Maybe Integer -> Maybe Text -> Maybe POSIX -> ScheduleAdBreak)
-> Parser (Maybe Text)
-> Parser
(Maybe Integer -> Maybe Text -> Maybe POSIX -> ScheduleAdBreak)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"SourceLocationName")
Parser
(Maybe Integer -> Maybe Text -> Maybe POSIX -> ScheduleAdBreak)
-> Parser (Maybe Integer)
-> Parser (Maybe Text -> Maybe POSIX -> ScheduleAdBreak)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Integer)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ApproximateDurationSeconds")
Parser (Maybe Text -> Maybe POSIX -> ScheduleAdBreak)
-> Parser (Maybe Text) -> Parser (Maybe POSIX -> ScheduleAdBreak)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"VodSourceName")
Parser (Maybe POSIX -> ScheduleAdBreak)
-> Parser (Maybe POSIX) -> Parser ScheduleAdBreak
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe POSIX)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ApproximateStartTime")
)
instance Prelude.Hashable ScheduleAdBreak
instance Prelude.NFData ScheduleAdBreak