{-# 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.Channel where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaTailor.Types.ResponseOutputItem
import Amazonka.MediaTailor.Types.SlateSource
import qualified Amazonka.Prelude as Prelude
data Channel = Channel'
{
Channel -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
Channel -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
Channel -> Maybe SlateSource
fillerSlate :: Prelude.Maybe SlateSource,
Channel -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
Channel -> Text
channelState :: Prelude.Text,
Channel -> Text
channelName :: Prelude.Text,
Channel -> [ResponseOutputItem]
outputs :: [ResponseOutputItem],
Channel -> Text
arn :: Prelude.Text,
Channel -> Text
playbackMode :: Prelude.Text
}
deriving (Channel -> Channel -> Bool
(Channel -> Channel -> Bool)
-> (Channel -> Channel -> Bool) -> Eq Channel
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Channel -> Channel -> Bool
$c/= :: Channel -> Channel -> Bool
== :: Channel -> Channel -> Bool
$c== :: Channel -> Channel -> Bool
Prelude.Eq, ReadPrec [Channel]
ReadPrec Channel
Int -> ReadS Channel
ReadS [Channel]
(Int -> ReadS Channel)
-> ReadS [Channel]
-> ReadPrec Channel
-> ReadPrec [Channel]
-> Read Channel
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [Channel]
$creadListPrec :: ReadPrec [Channel]
readPrec :: ReadPrec Channel
$creadPrec :: ReadPrec Channel
readList :: ReadS [Channel]
$creadList :: ReadS [Channel]
readsPrec :: Int -> ReadS Channel
$creadsPrec :: Int -> ReadS Channel
Prelude.Read, Int -> Channel -> ShowS
[Channel] -> ShowS
Channel -> String
(Int -> Channel -> ShowS)
-> (Channel -> String) -> ([Channel] -> ShowS) -> Show Channel
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Channel] -> ShowS
$cshowList :: [Channel] -> ShowS
show :: Channel -> String
$cshow :: Channel -> String
showsPrec :: Int -> Channel -> ShowS
$cshowsPrec :: Int -> Channel -> ShowS
Prelude.Show, (forall x. Channel -> Rep Channel x)
-> (forall x. Rep Channel x -> Channel) -> Generic Channel
forall x. Rep Channel x -> Channel
forall x. Channel -> Rep Channel x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep Channel x -> Channel
$cfrom :: forall x. Channel -> Rep Channel x
Prelude.Generic)
newChannel ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
Channel
newChannel :: Text -> Text -> Text -> Text -> Channel
newChannel
Text
pChannelState_
Text
pChannelName_
Text
pArn_
Text
pPlaybackMode_ =
Channel' :: Maybe POSIX
-> Maybe POSIX
-> Maybe SlateSource
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> [ResponseOutputItem]
-> Text
-> Text
-> Channel
Channel'
{ $sel:creationTime:Channel' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:lastModifiedTime:Channel' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:fillerSlate:Channel' :: Maybe SlateSource
fillerSlate = Maybe SlateSource
forall a. Maybe a
Prelude.Nothing,
$sel:tags:Channel' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:channelState:Channel' :: Text
channelState = Text
pChannelState_,
$sel:channelName:Channel' :: Text
channelName = Text
pChannelName_,
$sel:outputs:Channel' :: [ResponseOutputItem]
outputs = [ResponseOutputItem]
forall a. Monoid a => a
Prelude.mempty,
$sel:arn:Channel' :: Text
arn = Text
pArn_,
$sel:playbackMode:Channel' :: Text
playbackMode = Text
pPlaybackMode_
}
channel_creationTime :: Lens.Lens' Channel (Prelude.Maybe Prelude.UTCTime)
channel_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Channel -> f Channel
channel_creationTime = (Channel -> Maybe POSIX)
-> (Channel -> Maybe POSIX -> Channel)
-> Lens Channel Channel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:Channel' :: Channel -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: Channel
s@Channel' {} Maybe POSIX
a -> Channel
s {$sel:creationTime:Channel' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: Channel) ((Maybe POSIX -> f (Maybe POSIX)) -> Channel -> f Channel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Channel
-> f Channel
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
channel_lastModifiedTime :: Lens.Lens' Channel (Prelude.Maybe Prelude.UTCTime)
channel_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> Channel -> f Channel
channel_lastModifiedTime = (Channel -> Maybe POSIX)
-> (Channel -> Maybe POSIX -> Channel)
-> Lens Channel Channel (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:Channel' :: Channel -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: Channel
s@Channel' {} Maybe POSIX
a -> Channel
s {$sel:lastModifiedTime:Channel' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: Channel) ((Maybe POSIX -> f (Maybe POSIX)) -> Channel -> f Channel)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> Channel
-> f Channel
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
channel_fillerSlate :: Lens.Lens' Channel (Prelude.Maybe SlateSource)
channel_fillerSlate :: (Maybe SlateSource -> f (Maybe SlateSource))
-> Channel -> f Channel
channel_fillerSlate = (Channel -> Maybe SlateSource)
-> (Channel -> Maybe SlateSource -> Channel)
-> Lens Channel Channel (Maybe SlateSource) (Maybe SlateSource)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe SlateSource
fillerSlate :: Maybe SlateSource
$sel:fillerSlate:Channel' :: Channel -> Maybe SlateSource
fillerSlate} -> Maybe SlateSource
fillerSlate) (\s :: Channel
s@Channel' {} Maybe SlateSource
a -> Channel
s {$sel:fillerSlate:Channel' :: Maybe SlateSource
fillerSlate = Maybe SlateSource
a} :: Channel)
channel_tags :: Lens.Lens' Channel (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
channel_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Channel -> f Channel
channel_tags = (Channel -> Maybe (HashMap Text Text))
-> (Channel -> Maybe (HashMap Text Text) -> Channel)
-> Lens
Channel
Channel
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:Channel' :: Channel -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: Channel
s@Channel' {} Maybe (HashMap Text Text)
a -> Channel
s {$sel:tags:Channel' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: Channel) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Channel -> f Channel)
-> ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> Channel
-> f Channel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
-> Iso
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
(Maybe (HashMap Text Text))
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
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
(HashMap Text Text)
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
channel_channelState :: Lens.Lens' Channel Prelude.Text
channel_channelState :: (Text -> f Text) -> Channel -> f Channel
channel_channelState = (Channel -> Text)
-> (Channel -> Text -> Channel) -> Lens Channel Channel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Text
channelState :: Text
$sel:channelState:Channel' :: Channel -> Text
channelState} -> Text
channelState) (\s :: Channel
s@Channel' {} Text
a -> Channel
s {$sel:channelState:Channel' :: Text
channelState = Text
a} :: Channel)
channel_channelName :: Lens.Lens' Channel Prelude.Text
channel_channelName :: (Text -> f Text) -> Channel -> f Channel
channel_channelName = (Channel -> Text)
-> (Channel -> Text -> Channel) -> Lens Channel Channel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Text
channelName :: Text
$sel:channelName:Channel' :: Channel -> Text
channelName} -> Text
channelName) (\s :: Channel
s@Channel' {} Text
a -> Channel
s {$sel:channelName:Channel' :: Text
channelName = Text
a} :: Channel)
channel_outputs :: Lens.Lens' Channel [ResponseOutputItem]
channel_outputs :: ([ResponseOutputItem] -> f [ResponseOutputItem])
-> Channel -> f Channel
channel_outputs = (Channel -> [ResponseOutputItem])
-> (Channel -> [ResponseOutputItem] -> Channel)
-> Lens Channel Channel [ResponseOutputItem] [ResponseOutputItem]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {[ResponseOutputItem]
outputs :: [ResponseOutputItem]
$sel:outputs:Channel' :: Channel -> [ResponseOutputItem]
outputs} -> [ResponseOutputItem]
outputs) (\s :: Channel
s@Channel' {} [ResponseOutputItem]
a -> Channel
s {$sel:outputs:Channel' :: [ResponseOutputItem]
outputs = [ResponseOutputItem]
a} :: Channel) (([ResponseOutputItem] -> f [ResponseOutputItem])
-> Channel -> f Channel)
-> (([ResponseOutputItem] -> f [ResponseOutputItem])
-> [ResponseOutputItem] -> f [ResponseOutputItem])
-> ([ResponseOutputItem] -> f [ResponseOutputItem])
-> Channel
-> f Channel
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([ResponseOutputItem] -> f [ResponseOutputItem])
-> [ResponseOutputItem] -> f [ResponseOutputItem]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
channel_arn :: Lens.Lens' Channel Prelude.Text
channel_arn :: (Text -> f Text) -> Channel -> f Channel
channel_arn = (Channel -> Text)
-> (Channel -> Text -> Channel) -> Lens Channel Channel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Text
arn :: Text
$sel:arn:Channel' :: Channel -> Text
arn} -> Text
arn) (\s :: Channel
s@Channel' {} Text
a -> Channel
s {$sel:arn:Channel' :: Text
arn = Text
a} :: Channel)
channel_playbackMode :: Lens.Lens' Channel Prelude.Text
channel_playbackMode :: (Text -> f Text) -> Channel -> f Channel
channel_playbackMode = (Channel -> Text)
-> (Channel -> Text -> Channel) -> Lens Channel Channel Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\Channel' {Text
playbackMode :: Text
$sel:playbackMode:Channel' :: Channel -> Text
playbackMode} -> Text
playbackMode) (\s :: Channel
s@Channel' {} Text
a -> Channel
s {$sel:playbackMode:Channel' :: Text
playbackMode = Text
a} :: Channel)
instance Core.FromJSON Channel where
parseJSON :: Value -> Parser Channel
parseJSON =
String -> (Object -> Parser Channel) -> Value -> Parser Channel
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"Channel"
( \Object
x ->
Maybe POSIX
-> Maybe POSIX
-> Maybe SlateSource
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> [ResponseOutputItem]
-> Text
-> Text
-> Channel
Channel'
(Maybe POSIX
-> Maybe POSIX
-> Maybe SlateSource
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> [ResponseOutputItem]
-> Text
-> Text
-> Channel)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe SlateSource
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> [ResponseOutputItem]
-> Text
-> Text
-> Channel)
forall (f :: * -> *) a b. Functor 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
"CreationTime")
Parser
(Maybe POSIX
-> Maybe SlateSource
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> [ResponseOutputItem]
-> Text
-> Text
-> Channel)
-> Parser (Maybe POSIX)
-> Parser
(Maybe SlateSource
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> [ResponseOutputItem]
-> Text
-> Text
-> Channel)
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
"LastModifiedTime")
Parser
(Maybe SlateSource
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> [ResponseOutputItem]
-> Text
-> Text
-> Channel)
-> Parser (Maybe SlateSource)
-> Parser
(Maybe (HashMap Text Text)
-> Text -> Text -> [ResponseOutputItem] -> Text -> Text -> Channel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe SlateSource)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"FillerSlate")
Parser
(Maybe (HashMap Text Text)
-> Text -> Text -> [ResponseOutputItem] -> Text -> Text -> Channel)
-> Parser (Maybe (HashMap Text Text))
-> Parser
(Text -> Text -> [ResponseOutputItem] -> Text -> Text -> Channel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe (Maybe (HashMap Text Text)))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"tags" Parser (Maybe (Maybe (HashMap Text Text)))
-> Maybe (HashMap Text Text) -> Parser (Maybe (HashMap Text Text))
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe (HashMap Text Text)
forall a. Monoid a => a
Prelude.mempty)
Parser
(Text -> Text -> [ResponseOutputItem] -> Text -> Text -> Channel)
-> Parser Text
-> Parser (Text -> [ResponseOutputItem] -> Text -> Text -> Channel)
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
"ChannelState")
Parser (Text -> [ResponseOutputItem] -> Text -> Text -> Channel)
-> Parser Text
-> Parser ([ResponseOutputItem] -> Text -> Text -> Channel)
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 ([ResponseOutputItem] -> Text -> Text -> Channel)
-> Parser [ResponseOutputItem] -> Parser (Text -> Text -> Channel)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe [ResponseOutputItem])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"Outputs" Parser (Maybe [ResponseOutputItem])
-> [ResponseOutputItem] -> Parser [ResponseOutputItem]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [ResponseOutputItem]
forall a. Monoid a => a
Prelude.mempty)
Parser (Text -> Text -> Channel)
-> Parser Text -> Parser (Text -> Channel)
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 -> Channel) -> Parser Text -> Parser Channel
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
"PlaybackMode")
)
instance Prelude.Hashable Channel
instance Prelude.NFData Channel