{-# 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.ScheduleEntry where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaTailor.Types.ScheduleAdBreak
import Amazonka.MediaTailor.Types.ScheduleEntryType
import qualified Amazonka.Prelude as Prelude
data ScheduleEntry = ScheduleEntry'
{
ScheduleEntry -> Maybe [ScheduleAdBreak]
scheduleAdBreaks :: Prelude.Maybe [ScheduleAdBreak],
ScheduleEntry -> Maybe Integer
approximateDurationSeconds :: Prelude.Maybe Prelude.Integer,
ScheduleEntry -> Maybe POSIX
approximateStartTime :: Prelude.Maybe Core.POSIX,
ScheduleEntry -> Maybe ScheduleEntryType
scheduleEntryType :: Prelude.Maybe ScheduleEntryType,
ScheduleEntry -> Text
vodSourceName :: Prelude.Text,
ScheduleEntry -> Text
channelName :: Prelude.Text,
ScheduleEntry -> Text
sourceLocationName :: Prelude.Text,
ScheduleEntry -> Text
arn :: Prelude.Text,
ScheduleEntry -> Text
programName :: Prelude.Text
}
deriving (ScheduleEntry -> ScheduleEntry -> Bool
(ScheduleEntry -> ScheduleEntry -> Bool)
-> (ScheduleEntry -> ScheduleEntry -> Bool) -> Eq ScheduleEntry
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: ScheduleEntry -> ScheduleEntry -> Bool
$c/= :: ScheduleEntry -> ScheduleEntry -> Bool
== :: ScheduleEntry -> ScheduleEntry -> Bool
$c== :: ScheduleEntry -> ScheduleEntry -> Bool
Prelude.Eq, ReadPrec [ScheduleEntry]
ReadPrec ScheduleEntry
Int -> ReadS ScheduleEntry
ReadS [ScheduleEntry]
(Int -> ReadS ScheduleEntry)
-> ReadS [ScheduleEntry]
-> ReadPrec ScheduleEntry
-> ReadPrec [ScheduleEntry]
-> Read ScheduleEntry
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [ScheduleEntry]
$creadListPrec :: ReadPrec [ScheduleEntry]
readPrec :: ReadPrec ScheduleEntry
$creadPrec :: ReadPrec ScheduleEntry
readList :: ReadS [ScheduleEntry]
$creadList :: ReadS [ScheduleEntry]
readsPrec :: Int -> ReadS ScheduleEntry
$creadsPrec :: Int -> ReadS ScheduleEntry
Prelude.Read, Int -> ScheduleEntry -> ShowS
[ScheduleEntry] -> ShowS
ScheduleEntry -> String
(Int -> ScheduleEntry -> ShowS)
-> (ScheduleEntry -> String)
-> ([ScheduleEntry] -> ShowS)
-> Show ScheduleEntry
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [ScheduleEntry] -> ShowS
$cshowList :: [ScheduleEntry] -> ShowS
show :: ScheduleEntry -> String
$cshow :: ScheduleEntry -> String
showsPrec :: Int -> ScheduleEntry -> ShowS
$cshowsPrec :: Int -> ScheduleEntry -> ShowS
Prelude.Show, (forall x. ScheduleEntry -> Rep ScheduleEntry x)
-> (forall x. Rep ScheduleEntry x -> ScheduleEntry)
-> Generic ScheduleEntry
forall x. Rep ScheduleEntry x -> ScheduleEntry
forall x. ScheduleEntry -> Rep ScheduleEntry x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep ScheduleEntry x -> ScheduleEntry
$cfrom :: forall x. ScheduleEntry -> Rep ScheduleEntry x
Prelude.Generic)
newScheduleEntry ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
ScheduleEntry
newScheduleEntry :: Text -> Text -> Text -> Text -> Text -> ScheduleEntry
newScheduleEntry
Text
pVodSourceName_
Text
pChannelName_
Text
pSourceLocationName_
Text
pArn_
Text
pProgramName_ =
ScheduleEntry' :: Maybe [ScheduleAdBreak]
-> Maybe Integer
-> Maybe POSIX
-> Maybe ScheduleEntryType
-> Text
-> Text
-> Text
-> Text
-> Text
-> ScheduleEntry
ScheduleEntry'
{ $sel:scheduleAdBreaks:ScheduleEntry' :: Maybe [ScheduleAdBreak]
scheduleAdBreaks = Maybe [ScheduleAdBreak]
forall a. Maybe a
Prelude.Nothing,
$sel:approximateDurationSeconds:ScheduleEntry' :: Maybe Integer
approximateDurationSeconds = Maybe Integer
forall a. Maybe a
Prelude.Nothing,
$sel:approximateStartTime:ScheduleEntry' :: Maybe POSIX
approximateStartTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:scheduleEntryType:ScheduleEntry' :: Maybe ScheduleEntryType
scheduleEntryType = Maybe ScheduleEntryType
forall a. Maybe a
Prelude.Nothing,
$sel:vodSourceName:ScheduleEntry' :: Text
vodSourceName = Text
pVodSourceName_,
$sel:channelName:ScheduleEntry' :: Text
channelName = Text
pChannelName_,
$sel:sourceLocationName:ScheduleEntry' :: Text
sourceLocationName = Text
pSourceLocationName_,
$sel:arn:ScheduleEntry' :: Text
arn = Text
pArn_,
$sel:programName:ScheduleEntry' :: Text
programName = Text
pProgramName_
}
scheduleEntry_scheduleAdBreaks :: Lens.Lens' ScheduleEntry (Prelude.Maybe [ScheduleAdBreak])
scheduleEntry_scheduleAdBreaks :: (Maybe [ScheduleAdBreak] -> f (Maybe [ScheduleAdBreak]))
-> ScheduleEntry -> f ScheduleEntry
scheduleEntry_scheduleAdBreaks = (ScheduleEntry -> Maybe [ScheduleAdBreak])
-> (ScheduleEntry -> Maybe [ScheduleAdBreak] -> ScheduleEntry)
-> Lens
ScheduleEntry
ScheduleEntry
(Maybe [ScheduleAdBreak])
(Maybe [ScheduleAdBreak])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleEntry' {Maybe [ScheduleAdBreak]
scheduleAdBreaks :: Maybe [ScheduleAdBreak]
$sel:scheduleAdBreaks:ScheduleEntry' :: ScheduleEntry -> Maybe [ScheduleAdBreak]
scheduleAdBreaks} -> Maybe [ScheduleAdBreak]
scheduleAdBreaks) (\s :: ScheduleEntry
s@ScheduleEntry' {} Maybe [ScheduleAdBreak]
a -> ScheduleEntry
s {$sel:scheduleAdBreaks:ScheduleEntry' :: Maybe [ScheduleAdBreak]
scheduleAdBreaks = Maybe [ScheduleAdBreak]
a} :: ScheduleEntry) ((Maybe [ScheduleAdBreak] -> f (Maybe [ScheduleAdBreak]))
-> ScheduleEntry -> f ScheduleEntry)
-> ((Maybe [ScheduleAdBreak] -> f (Maybe [ScheduleAdBreak]))
-> Maybe [ScheduleAdBreak] -> f (Maybe [ScheduleAdBreak]))
-> (Maybe [ScheduleAdBreak] -> f (Maybe [ScheduleAdBreak]))
-> ScheduleEntry
-> f ScheduleEntry
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
[ScheduleAdBreak]
[ScheduleAdBreak]
[ScheduleAdBreak]
[ScheduleAdBreak]
-> Iso
(Maybe [ScheduleAdBreak])
(Maybe [ScheduleAdBreak])
(Maybe [ScheduleAdBreak])
(Maybe [ScheduleAdBreak])
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
[ScheduleAdBreak]
[ScheduleAdBreak]
[ScheduleAdBreak]
[ScheduleAdBreak]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
scheduleEntry_approximateDurationSeconds :: Lens.Lens' ScheduleEntry (Prelude.Maybe Prelude.Integer)
scheduleEntry_approximateDurationSeconds :: (Maybe Integer -> f (Maybe Integer))
-> ScheduleEntry -> f ScheduleEntry
scheduleEntry_approximateDurationSeconds = (ScheduleEntry -> Maybe Integer)
-> (ScheduleEntry -> Maybe Integer -> ScheduleEntry)
-> Lens ScheduleEntry ScheduleEntry (Maybe Integer) (Maybe Integer)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleEntry' {Maybe Integer
approximateDurationSeconds :: Maybe Integer
$sel:approximateDurationSeconds:ScheduleEntry' :: ScheduleEntry -> Maybe Integer
approximateDurationSeconds} -> Maybe Integer
approximateDurationSeconds) (\s :: ScheduleEntry
s@ScheduleEntry' {} Maybe Integer
a -> ScheduleEntry
s {$sel:approximateDurationSeconds:ScheduleEntry' :: Maybe Integer
approximateDurationSeconds = Maybe Integer
a} :: ScheduleEntry)
scheduleEntry_approximateStartTime :: Lens.Lens' ScheduleEntry (Prelude.Maybe Prelude.UTCTime)
scheduleEntry_approximateStartTime :: (Maybe UTCTime -> f (Maybe UTCTime))
-> ScheduleEntry -> f ScheduleEntry
scheduleEntry_approximateStartTime = (ScheduleEntry -> Maybe POSIX)
-> (ScheduleEntry -> Maybe POSIX -> ScheduleEntry)
-> Lens ScheduleEntry ScheduleEntry (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleEntry' {Maybe POSIX
approximateStartTime :: Maybe POSIX
$sel:approximateStartTime:ScheduleEntry' :: ScheduleEntry -> Maybe POSIX
approximateStartTime} -> Maybe POSIX
approximateStartTime) (\s :: ScheduleEntry
s@ScheduleEntry' {} Maybe POSIX
a -> ScheduleEntry
s {$sel:approximateStartTime:ScheduleEntry' :: Maybe POSIX
approximateStartTime = Maybe POSIX
a} :: ScheduleEntry) ((Maybe POSIX -> f (Maybe POSIX))
-> ScheduleEntry -> f ScheduleEntry)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> ScheduleEntry
-> f ScheduleEntry
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
scheduleEntry_scheduleEntryType :: Lens.Lens' ScheduleEntry (Prelude.Maybe ScheduleEntryType)
scheduleEntry_scheduleEntryType :: (Maybe ScheduleEntryType -> f (Maybe ScheduleEntryType))
-> ScheduleEntry -> f ScheduleEntry
scheduleEntry_scheduleEntryType = (ScheduleEntry -> Maybe ScheduleEntryType)
-> (ScheduleEntry -> Maybe ScheduleEntryType -> ScheduleEntry)
-> Lens
ScheduleEntry
ScheduleEntry
(Maybe ScheduleEntryType)
(Maybe ScheduleEntryType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleEntry' {Maybe ScheduleEntryType
scheduleEntryType :: Maybe ScheduleEntryType
$sel:scheduleEntryType:ScheduleEntry' :: ScheduleEntry -> Maybe ScheduleEntryType
scheduleEntryType} -> Maybe ScheduleEntryType
scheduleEntryType) (\s :: ScheduleEntry
s@ScheduleEntry' {} Maybe ScheduleEntryType
a -> ScheduleEntry
s {$sel:scheduleEntryType:ScheduleEntry' :: Maybe ScheduleEntryType
scheduleEntryType = Maybe ScheduleEntryType
a} :: ScheduleEntry)
scheduleEntry_vodSourceName :: Lens.Lens' ScheduleEntry Prelude.Text
scheduleEntry_vodSourceName :: (Text -> f Text) -> ScheduleEntry -> f ScheduleEntry
scheduleEntry_vodSourceName = (ScheduleEntry -> Text)
-> (ScheduleEntry -> Text -> ScheduleEntry)
-> Lens ScheduleEntry ScheduleEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleEntry' {Text
vodSourceName :: Text
$sel:vodSourceName:ScheduleEntry' :: ScheduleEntry -> Text
vodSourceName} -> Text
vodSourceName) (\s :: ScheduleEntry
s@ScheduleEntry' {} Text
a -> ScheduleEntry
s {$sel:vodSourceName:ScheduleEntry' :: Text
vodSourceName = Text
a} :: ScheduleEntry)
scheduleEntry_channelName :: Lens.Lens' ScheduleEntry Prelude.Text
scheduleEntry_channelName :: (Text -> f Text) -> ScheduleEntry -> f ScheduleEntry
scheduleEntry_channelName = (ScheduleEntry -> Text)
-> (ScheduleEntry -> Text -> ScheduleEntry)
-> Lens ScheduleEntry ScheduleEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleEntry' {Text
channelName :: Text
$sel:channelName:ScheduleEntry' :: ScheduleEntry -> Text
channelName} -> Text
channelName) (\s :: ScheduleEntry
s@ScheduleEntry' {} Text
a -> ScheduleEntry
s {$sel:channelName:ScheduleEntry' :: Text
channelName = Text
a} :: ScheduleEntry)
scheduleEntry_sourceLocationName :: Lens.Lens' ScheduleEntry Prelude.Text
scheduleEntry_sourceLocationName :: (Text -> f Text) -> ScheduleEntry -> f ScheduleEntry
scheduleEntry_sourceLocationName = (ScheduleEntry -> Text)
-> (ScheduleEntry -> Text -> ScheduleEntry)
-> Lens ScheduleEntry ScheduleEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleEntry' {Text
sourceLocationName :: Text
$sel:sourceLocationName:ScheduleEntry' :: ScheduleEntry -> Text
sourceLocationName} -> Text
sourceLocationName) (\s :: ScheduleEntry
s@ScheduleEntry' {} Text
a -> ScheduleEntry
s {$sel:sourceLocationName:ScheduleEntry' :: Text
sourceLocationName = Text
a} :: ScheduleEntry)
scheduleEntry_arn :: Lens.Lens' ScheduleEntry Prelude.Text
scheduleEntry_arn :: (Text -> f Text) -> ScheduleEntry -> f ScheduleEntry
scheduleEntry_arn = (ScheduleEntry -> Text)
-> (ScheduleEntry -> Text -> ScheduleEntry)
-> Lens ScheduleEntry ScheduleEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleEntry' {Text
arn :: Text
$sel:arn:ScheduleEntry' :: ScheduleEntry -> Text
arn} -> Text
arn) (\s :: ScheduleEntry
s@ScheduleEntry' {} Text
a -> ScheduleEntry
s {$sel:arn:ScheduleEntry' :: Text
arn = Text
a} :: ScheduleEntry)
scheduleEntry_programName :: Lens.Lens' ScheduleEntry Prelude.Text
scheduleEntry_programName :: (Text -> f Text) -> ScheduleEntry -> f ScheduleEntry
scheduleEntry_programName = (ScheduleEntry -> Text)
-> (ScheduleEntry -> Text -> ScheduleEntry)
-> Lens ScheduleEntry ScheduleEntry Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\ScheduleEntry' {Text
programName :: Text
$sel:programName:ScheduleEntry' :: ScheduleEntry -> Text
programName} -> Text
programName) (\s :: ScheduleEntry
s@ScheduleEntry' {} Text
a -> ScheduleEntry
s {$sel:programName:ScheduleEntry' :: Text
programName = Text
a} :: ScheduleEntry)
instance Core.FromJSON ScheduleEntry where
parseJSON :: Value -> Parser ScheduleEntry
parseJSON =
String
-> (Object -> Parser ScheduleEntry)
-> Value
-> Parser ScheduleEntry
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"ScheduleEntry"
( \Object
x ->
Maybe [ScheduleAdBreak]
-> Maybe Integer
-> Maybe POSIX
-> Maybe ScheduleEntryType
-> Text
-> Text
-> Text
-> Text
-> Text
-> ScheduleEntry
ScheduleEntry'
(Maybe [ScheduleAdBreak]
-> Maybe Integer
-> Maybe POSIX
-> Maybe ScheduleEntryType
-> Text
-> Text
-> Text
-> Text
-> Text
-> ScheduleEntry)
-> Parser (Maybe [ScheduleAdBreak])
-> Parser
(Maybe Integer
-> Maybe POSIX
-> Maybe ScheduleEntryType
-> Text
-> Text
-> Text
-> Text
-> Text
-> ScheduleEntry)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> ( Object
x Object -> Text -> Parser (Maybe (Maybe [ScheduleAdBreak]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ScheduleAdBreaks"
Parser (Maybe (Maybe [ScheduleAdBreak]))
-> Maybe [ScheduleAdBreak] -> Parser (Maybe [ScheduleAdBreak])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [ScheduleAdBreak]
forall a. Monoid a => a
Prelude.mempty
)
Parser
(Maybe Integer
-> Maybe POSIX
-> Maybe ScheduleEntryType
-> Text
-> Text
-> Text
-> Text
-> Text
-> ScheduleEntry)
-> Parser (Maybe Integer)
-> Parser
(Maybe POSIX
-> Maybe ScheduleEntryType
-> Text
-> Text
-> Text
-> Text
-> Text
-> ScheduleEntry)
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 POSIX
-> Maybe ScheduleEntryType
-> Text
-> Text
-> Text
-> Text
-> Text
-> ScheduleEntry)
-> Parser (Maybe POSIX)
-> Parser
(Maybe ScheduleEntryType
-> Text -> Text -> Text -> Text -> Text -> ScheduleEntry)
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")
Parser
(Maybe ScheduleEntryType
-> Text -> Text -> Text -> Text -> Text -> ScheduleEntry)
-> Parser (Maybe ScheduleEntryType)
-> Parser (Text -> Text -> Text -> Text -> Text -> ScheduleEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe ScheduleEntryType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"ScheduleEntryType")
Parser (Text -> Text -> Text -> Text -> Text -> ScheduleEntry)
-> Parser Text
-> Parser (Text -> Text -> Text -> Text -> ScheduleEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"VodSourceName")
Parser (Text -> Text -> Text -> Text -> ScheduleEntry)
-> Parser Text -> Parser (Text -> Text -> Text -> ScheduleEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ChannelName")
Parser (Text -> Text -> Text -> ScheduleEntry)
-> Parser Text -> Parser (Text -> Text -> ScheduleEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"SourceLocationName")
Parser (Text -> Text -> ScheduleEntry)
-> Parser Text -> Parser (Text -> ScheduleEntry)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Arn")
Parser (Text -> ScheduleEntry)
-> Parser Text -> Parser ScheduleEntry
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"ProgramName")
)
instance Prelude.Hashable ScheduleEntry
instance Prelude.NFData ScheduleEntry