{-# 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.PrefetchSchedule where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaTailor.Types.PrefetchConsumption
import Amazonka.MediaTailor.Types.PrefetchRetrieval
import qualified Amazonka.Prelude as Prelude
data PrefetchSchedule = PrefetchSchedule'
{
PrefetchSchedule -> Maybe Text
streamId :: Prelude.Maybe Prelude.Text,
PrefetchSchedule -> PrefetchRetrieval
retrieval :: PrefetchRetrieval,
PrefetchSchedule -> PrefetchConsumption
consumption :: PrefetchConsumption,
PrefetchSchedule -> Text
arn :: Prelude.Text,
PrefetchSchedule -> Text
playbackConfigurationName :: Prelude.Text,
PrefetchSchedule -> Text
name :: Prelude.Text
}
deriving (PrefetchSchedule -> PrefetchSchedule -> Bool
(PrefetchSchedule -> PrefetchSchedule -> Bool)
-> (PrefetchSchedule -> PrefetchSchedule -> Bool)
-> Eq PrefetchSchedule
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: PrefetchSchedule -> PrefetchSchedule -> Bool
$c/= :: PrefetchSchedule -> PrefetchSchedule -> Bool
== :: PrefetchSchedule -> PrefetchSchedule -> Bool
$c== :: PrefetchSchedule -> PrefetchSchedule -> Bool
Prelude.Eq, ReadPrec [PrefetchSchedule]
ReadPrec PrefetchSchedule
Int -> ReadS PrefetchSchedule
ReadS [PrefetchSchedule]
(Int -> ReadS PrefetchSchedule)
-> ReadS [PrefetchSchedule]
-> ReadPrec PrefetchSchedule
-> ReadPrec [PrefetchSchedule]
-> Read PrefetchSchedule
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [PrefetchSchedule]
$creadListPrec :: ReadPrec [PrefetchSchedule]
readPrec :: ReadPrec PrefetchSchedule
$creadPrec :: ReadPrec PrefetchSchedule
readList :: ReadS [PrefetchSchedule]
$creadList :: ReadS [PrefetchSchedule]
readsPrec :: Int -> ReadS PrefetchSchedule
$creadsPrec :: Int -> ReadS PrefetchSchedule
Prelude.Read, Int -> PrefetchSchedule -> ShowS
[PrefetchSchedule] -> ShowS
PrefetchSchedule -> String
(Int -> PrefetchSchedule -> ShowS)
-> (PrefetchSchedule -> String)
-> ([PrefetchSchedule] -> ShowS)
-> Show PrefetchSchedule
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [PrefetchSchedule] -> ShowS
$cshowList :: [PrefetchSchedule] -> ShowS
show :: PrefetchSchedule -> String
$cshow :: PrefetchSchedule -> String
showsPrec :: Int -> PrefetchSchedule -> ShowS
$cshowsPrec :: Int -> PrefetchSchedule -> ShowS
Prelude.Show, (forall x. PrefetchSchedule -> Rep PrefetchSchedule x)
-> (forall x. Rep PrefetchSchedule x -> PrefetchSchedule)
-> Generic PrefetchSchedule
forall x. Rep PrefetchSchedule x -> PrefetchSchedule
forall x. PrefetchSchedule -> Rep PrefetchSchedule x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep PrefetchSchedule x -> PrefetchSchedule
$cfrom :: forall x. PrefetchSchedule -> Rep PrefetchSchedule x
Prelude.Generic)
newPrefetchSchedule ::
PrefetchRetrieval ->
PrefetchConsumption ->
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
PrefetchSchedule
newPrefetchSchedule :: PrefetchRetrieval
-> PrefetchConsumption -> Text -> Text -> Text -> PrefetchSchedule
newPrefetchSchedule
PrefetchRetrieval
pRetrieval_
PrefetchConsumption
pConsumption_
Text
pArn_
Text
pPlaybackConfigurationName_
Text
pName_ =
PrefetchSchedule' :: Maybe Text
-> PrefetchRetrieval
-> PrefetchConsumption
-> Text
-> Text
-> Text
-> PrefetchSchedule
PrefetchSchedule'
{ $sel:streamId:PrefetchSchedule' :: Maybe Text
streamId = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:retrieval:PrefetchSchedule' :: PrefetchRetrieval
retrieval = PrefetchRetrieval
pRetrieval_,
$sel:consumption:PrefetchSchedule' :: PrefetchConsumption
consumption = PrefetchConsumption
pConsumption_,
$sel:arn:PrefetchSchedule' :: Text
arn = Text
pArn_,
$sel:playbackConfigurationName:PrefetchSchedule' :: Text
playbackConfigurationName =
Text
pPlaybackConfigurationName_,
$sel:name:PrefetchSchedule' :: Text
name = Text
pName_
}
prefetchSchedule_streamId :: Lens.Lens' PrefetchSchedule (Prelude.Maybe Prelude.Text)
prefetchSchedule_streamId :: (Maybe Text -> f (Maybe Text))
-> PrefetchSchedule -> f PrefetchSchedule
prefetchSchedule_streamId = (PrefetchSchedule -> Maybe Text)
-> (PrefetchSchedule -> Maybe Text -> PrefetchSchedule)
-> Lens PrefetchSchedule PrefetchSchedule (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrefetchSchedule' {Maybe Text
streamId :: Maybe Text
$sel:streamId:PrefetchSchedule' :: PrefetchSchedule -> Maybe Text
streamId} -> Maybe Text
streamId) (\s :: PrefetchSchedule
s@PrefetchSchedule' {} Maybe Text
a -> PrefetchSchedule
s {$sel:streamId:PrefetchSchedule' :: Maybe Text
streamId = Maybe Text
a} :: PrefetchSchedule)
prefetchSchedule_retrieval :: Lens.Lens' PrefetchSchedule PrefetchRetrieval
prefetchSchedule_retrieval :: (PrefetchRetrieval -> f PrefetchRetrieval)
-> PrefetchSchedule -> f PrefetchSchedule
prefetchSchedule_retrieval = (PrefetchSchedule -> PrefetchRetrieval)
-> (PrefetchSchedule -> PrefetchRetrieval -> PrefetchSchedule)
-> Lens
PrefetchSchedule
PrefetchSchedule
PrefetchRetrieval
PrefetchRetrieval
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrefetchSchedule' {PrefetchRetrieval
retrieval :: PrefetchRetrieval
$sel:retrieval:PrefetchSchedule' :: PrefetchSchedule -> PrefetchRetrieval
retrieval} -> PrefetchRetrieval
retrieval) (\s :: PrefetchSchedule
s@PrefetchSchedule' {} PrefetchRetrieval
a -> PrefetchSchedule
s {$sel:retrieval:PrefetchSchedule' :: PrefetchRetrieval
retrieval = PrefetchRetrieval
a} :: PrefetchSchedule)
prefetchSchedule_consumption :: Lens.Lens' PrefetchSchedule PrefetchConsumption
prefetchSchedule_consumption :: (PrefetchConsumption -> f PrefetchConsumption)
-> PrefetchSchedule -> f PrefetchSchedule
prefetchSchedule_consumption = (PrefetchSchedule -> PrefetchConsumption)
-> (PrefetchSchedule -> PrefetchConsumption -> PrefetchSchedule)
-> Lens
PrefetchSchedule
PrefetchSchedule
PrefetchConsumption
PrefetchConsumption
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrefetchSchedule' {PrefetchConsumption
consumption :: PrefetchConsumption
$sel:consumption:PrefetchSchedule' :: PrefetchSchedule -> PrefetchConsumption
consumption} -> PrefetchConsumption
consumption) (\s :: PrefetchSchedule
s@PrefetchSchedule' {} PrefetchConsumption
a -> PrefetchSchedule
s {$sel:consumption:PrefetchSchedule' :: PrefetchConsumption
consumption = PrefetchConsumption
a} :: PrefetchSchedule)
prefetchSchedule_arn :: Lens.Lens' PrefetchSchedule Prelude.Text
prefetchSchedule_arn :: (Text -> f Text) -> PrefetchSchedule -> f PrefetchSchedule
prefetchSchedule_arn = (PrefetchSchedule -> Text)
-> (PrefetchSchedule -> Text -> PrefetchSchedule)
-> Lens PrefetchSchedule PrefetchSchedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrefetchSchedule' {Text
arn :: Text
$sel:arn:PrefetchSchedule' :: PrefetchSchedule -> Text
arn} -> Text
arn) (\s :: PrefetchSchedule
s@PrefetchSchedule' {} Text
a -> PrefetchSchedule
s {$sel:arn:PrefetchSchedule' :: Text
arn = Text
a} :: PrefetchSchedule)
prefetchSchedule_playbackConfigurationName :: Lens.Lens' PrefetchSchedule Prelude.Text
prefetchSchedule_playbackConfigurationName :: (Text -> f Text) -> PrefetchSchedule -> f PrefetchSchedule
prefetchSchedule_playbackConfigurationName = (PrefetchSchedule -> Text)
-> (PrefetchSchedule -> Text -> PrefetchSchedule)
-> Lens PrefetchSchedule PrefetchSchedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrefetchSchedule' {Text
playbackConfigurationName :: Text
$sel:playbackConfigurationName:PrefetchSchedule' :: PrefetchSchedule -> Text
playbackConfigurationName} -> Text
playbackConfigurationName) (\s :: PrefetchSchedule
s@PrefetchSchedule' {} Text
a -> PrefetchSchedule
s {$sel:playbackConfigurationName:PrefetchSchedule' :: Text
playbackConfigurationName = Text
a} :: PrefetchSchedule)
prefetchSchedule_name :: Lens.Lens' PrefetchSchedule Prelude.Text
prefetchSchedule_name :: (Text -> f Text) -> PrefetchSchedule -> f PrefetchSchedule
prefetchSchedule_name = (PrefetchSchedule -> Text)
-> (PrefetchSchedule -> Text -> PrefetchSchedule)
-> Lens PrefetchSchedule PrefetchSchedule Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\PrefetchSchedule' {Text
name :: Text
$sel:name:PrefetchSchedule' :: PrefetchSchedule -> Text
name} -> Text
name) (\s :: PrefetchSchedule
s@PrefetchSchedule' {} Text
a -> PrefetchSchedule
s {$sel:name:PrefetchSchedule' :: Text
name = Text
a} :: PrefetchSchedule)
instance Core.FromJSON PrefetchSchedule where
parseJSON :: Value -> Parser PrefetchSchedule
parseJSON =
String
-> (Object -> Parser PrefetchSchedule)
-> Value
-> Parser PrefetchSchedule
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"PrefetchSchedule"
( \Object
x ->
Maybe Text
-> PrefetchRetrieval
-> PrefetchConsumption
-> Text
-> Text
-> Text
-> PrefetchSchedule
PrefetchSchedule'
(Maybe Text
-> PrefetchRetrieval
-> PrefetchConsumption
-> Text
-> Text
-> Text
-> PrefetchSchedule)
-> Parser (Maybe Text)
-> Parser
(PrefetchRetrieval
-> PrefetchConsumption -> Text -> Text -> Text -> PrefetchSchedule)
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
"StreamId")
Parser
(PrefetchRetrieval
-> PrefetchConsumption -> Text -> Text -> Text -> PrefetchSchedule)
-> Parser PrefetchRetrieval
-> Parser
(PrefetchConsumption -> Text -> Text -> Text -> PrefetchSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser PrefetchRetrieval
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Retrieval")
Parser
(PrefetchConsumption -> Text -> Text -> Text -> PrefetchSchedule)
-> Parser PrefetchConsumption
-> Parser (Text -> Text -> Text -> PrefetchSchedule)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser PrefetchConsumption
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"Consumption")
Parser (Text -> Text -> Text -> PrefetchSchedule)
-> Parser Text -> Parser (Text -> Text -> PrefetchSchedule)
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 -> Text -> PrefetchSchedule)
-> Parser Text -> Parser (Text -> PrefetchSchedule)
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
"PlaybackConfigurationName")
Parser (Text -> PrefetchSchedule)
-> Parser Text -> Parser PrefetchSchedule
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
"Name")
)
instance Prelude.Hashable PrefetchSchedule
instance Prelude.NFData PrefetchSchedule