{-# 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.VodSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaTailor.Types.HttpPackageConfiguration
import qualified Amazonka.Prelude as Prelude
data VodSource = VodSource'
{
VodSource -> Maybe POSIX
creationTime :: Prelude.Maybe Core.POSIX,
VodSource -> Maybe POSIX
lastModifiedTime :: Prelude.Maybe Core.POSIX,
VodSource -> Maybe (HashMap Text Text)
tags :: Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text),
VodSource -> Text
vodSourceName :: Prelude.Text,
VodSource -> Text
sourceLocationName :: Prelude.Text,
VodSource -> [HttpPackageConfiguration]
httpPackageConfigurations :: [HttpPackageConfiguration],
VodSource -> Text
arn :: Prelude.Text
}
deriving (VodSource -> VodSource -> Bool
(VodSource -> VodSource -> Bool)
-> (VodSource -> VodSource -> Bool) -> Eq VodSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: VodSource -> VodSource -> Bool
$c/= :: VodSource -> VodSource -> Bool
== :: VodSource -> VodSource -> Bool
$c== :: VodSource -> VodSource -> Bool
Prelude.Eq, ReadPrec [VodSource]
ReadPrec VodSource
Int -> ReadS VodSource
ReadS [VodSource]
(Int -> ReadS VodSource)
-> ReadS [VodSource]
-> ReadPrec VodSource
-> ReadPrec [VodSource]
-> Read VodSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [VodSource]
$creadListPrec :: ReadPrec [VodSource]
readPrec :: ReadPrec VodSource
$creadPrec :: ReadPrec VodSource
readList :: ReadS [VodSource]
$creadList :: ReadS [VodSource]
readsPrec :: Int -> ReadS VodSource
$creadsPrec :: Int -> ReadS VodSource
Prelude.Read, Int -> VodSource -> ShowS
[VodSource] -> ShowS
VodSource -> String
(Int -> VodSource -> ShowS)
-> (VodSource -> String)
-> ([VodSource] -> ShowS)
-> Show VodSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [VodSource] -> ShowS
$cshowList :: [VodSource] -> ShowS
show :: VodSource -> String
$cshow :: VodSource -> String
showsPrec :: Int -> VodSource -> ShowS
$cshowsPrec :: Int -> VodSource -> ShowS
Prelude.Show, (forall x. VodSource -> Rep VodSource x)
-> (forall x. Rep VodSource x -> VodSource) -> Generic VodSource
forall x. Rep VodSource x -> VodSource
forall x. VodSource -> Rep VodSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep VodSource x -> VodSource
$cfrom :: forall x. VodSource -> Rep VodSource x
Prelude.Generic)
newVodSource ::
Prelude.Text ->
Prelude.Text ->
Prelude.Text ->
VodSource
newVodSource :: Text -> Text -> Text -> VodSource
newVodSource
Text
pVodSourceName_
Text
pSourceLocationName_
Text
pArn_ =
VodSource' :: Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> [HttpPackageConfiguration]
-> Text
-> VodSource
VodSource'
{ $sel:creationTime:VodSource' :: Maybe POSIX
creationTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:lastModifiedTime:VodSource' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
forall a. Maybe a
Prelude.Nothing,
$sel:tags:VodSource' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
forall a. Maybe a
Prelude.Nothing,
$sel:vodSourceName:VodSource' :: Text
vodSourceName = Text
pVodSourceName_,
$sel:sourceLocationName:VodSource' :: Text
sourceLocationName = Text
pSourceLocationName_,
$sel:httpPackageConfigurations:VodSource' :: [HttpPackageConfiguration]
httpPackageConfigurations = [HttpPackageConfiguration]
forall a. Monoid a => a
Prelude.mempty,
$sel:arn:VodSource' :: Text
arn = Text
pArn_
}
vodSource_creationTime :: Lens.Lens' VodSource (Prelude.Maybe Prelude.UTCTime)
vodSource_creationTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> VodSource -> f VodSource
vodSource_creationTime = (VodSource -> Maybe POSIX)
-> (VodSource -> Maybe POSIX -> VodSource)
-> Lens VodSource VodSource (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VodSource' {Maybe POSIX
creationTime :: Maybe POSIX
$sel:creationTime:VodSource' :: VodSource -> Maybe POSIX
creationTime} -> Maybe POSIX
creationTime) (\s :: VodSource
s@VodSource' {} Maybe POSIX
a -> VodSource
s {$sel:creationTime:VodSource' :: Maybe POSIX
creationTime = Maybe POSIX
a} :: VodSource) ((Maybe POSIX -> f (Maybe POSIX)) -> VodSource -> f VodSource)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> VodSource
-> f VodSource
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
vodSource_lastModifiedTime :: Lens.Lens' VodSource (Prelude.Maybe Prelude.UTCTime)
vodSource_lastModifiedTime :: (Maybe UTCTime -> f (Maybe UTCTime)) -> VodSource -> f VodSource
vodSource_lastModifiedTime = (VodSource -> Maybe POSIX)
-> (VodSource -> Maybe POSIX -> VodSource)
-> Lens VodSource VodSource (Maybe POSIX) (Maybe POSIX)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VodSource' {Maybe POSIX
lastModifiedTime :: Maybe POSIX
$sel:lastModifiedTime:VodSource' :: VodSource -> Maybe POSIX
lastModifiedTime} -> Maybe POSIX
lastModifiedTime) (\s :: VodSource
s@VodSource' {} Maybe POSIX
a -> VodSource
s {$sel:lastModifiedTime:VodSource' :: Maybe POSIX
lastModifiedTime = Maybe POSIX
a} :: VodSource) ((Maybe POSIX -> f (Maybe POSIX)) -> VodSource -> f VodSource)
-> ((Maybe UTCTime -> f (Maybe UTCTime))
-> Maybe POSIX -> f (Maybe POSIX))
-> (Maybe UTCTime -> f (Maybe UTCTime))
-> VodSource
-> f VodSource
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
vodSource_tags :: Lens.Lens' VodSource (Prelude.Maybe (Prelude.HashMap Prelude.Text Prelude.Text))
vodSource_tags :: (Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> VodSource -> f VodSource
vodSource_tags = (VodSource -> Maybe (HashMap Text Text))
-> (VodSource -> Maybe (HashMap Text Text) -> VodSource)
-> Lens
VodSource
VodSource
(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 (\VodSource' {Maybe (HashMap Text Text)
tags :: Maybe (HashMap Text Text)
$sel:tags:VodSource' :: VodSource -> Maybe (HashMap Text Text)
tags} -> Maybe (HashMap Text Text)
tags) (\s :: VodSource
s@VodSource' {} Maybe (HashMap Text Text)
a -> VodSource
s {$sel:tags:VodSource' :: Maybe (HashMap Text Text)
tags = Maybe (HashMap Text Text)
a} :: VodSource) ((Maybe (HashMap Text Text) -> f (Maybe (HashMap Text Text)))
-> VodSource -> f VodSource)
-> ((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)))
-> VodSource
-> f VodSource
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
vodSource_vodSourceName :: Lens.Lens' VodSource Prelude.Text
vodSource_vodSourceName :: (Text -> f Text) -> VodSource -> f VodSource
vodSource_vodSourceName = (VodSource -> Text)
-> (VodSource -> Text -> VodSource)
-> Lens VodSource VodSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VodSource' {Text
vodSourceName :: Text
$sel:vodSourceName:VodSource' :: VodSource -> Text
vodSourceName} -> Text
vodSourceName) (\s :: VodSource
s@VodSource' {} Text
a -> VodSource
s {$sel:vodSourceName:VodSource' :: Text
vodSourceName = Text
a} :: VodSource)
vodSource_sourceLocationName :: Lens.Lens' VodSource Prelude.Text
vodSource_sourceLocationName :: (Text -> f Text) -> VodSource -> f VodSource
vodSource_sourceLocationName = (VodSource -> Text)
-> (VodSource -> Text -> VodSource)
-> Lens VodSource VodSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VodSource' {Text
sourceLocationName :: Text
$sel:sourceLocationName:VodSource' :: VodSource -> Text
sourceLocationName} -> Text
sourceLocationName) (\s :: VodSource
s@VodSource' {} Text
a -> VodSource
s {$sel:sourceLocationName:VodSource' :: Text
sourceLocationName = Text
a} :: VodSource)
vodSource_httpPackageConfigurations :: Lens.Lens' VodSource [HttpPackageConfiguration]
vodSource_httpPackageConfigurations :: ([HttpPackageConfiguration] -> f [HttpPackageConfiguration])
-> VodSource -> f VodSource
vodSource_httpPackageConfigurations = (VodSource -> [HttpPackageConfiguration])
-> (VodSource -> [HttpPackageConfiguration] -> VodSource)
-> Lens
VodSource
VodSource
[HttpPackageConfiguration]
[HttpPackageConfiguration]
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VodSource' {[HttpPackageConfiguration]
httpPackageConfigurations :: [HttpPackageConfiguration]
$sel:httpPackageConfigurations:VodSource' :: VodSource -> [HttpPackageConfiguration]
httpPackageConfigurations} -> [HttpPackageConfiguration]
httpPackageConfigurations) (\s :: VodSource
s@VodSource' {} [HttpPackageConfiguration]
a -> VodSource
s {$sel:httpPackageConfigurations:VodSource' :: [HttpPackageConfiguration]
httpPackageConfigurations = [HttpPackageConfiguration]
a} :: VodSource) (([HttpPackageConfiguration] -> f [HttpPackageConfiguration])
-> VodSource -> f VodSource)
-> (([HttpPackageConfiguration] -> f [HttpPackageConfiguration])
-> [HttpPackageConfiguration] -> f [HttpPackageConfiguration])
-> ([HttpPackageConfiguration] -> f [HttpPackageConfiguration])
-> VodSource
-> f VodSource
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. ([HttpPackageConfiguration] -> f [HttpPackageConfiguration])
-> [HttpPackageConfiguration] -> f [HttpPackageConfiguration]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced
vodSource_arn :: Lens.Lens' VodSource Prelude.Text
vodSource_arn :: (Text -> f Text) -> VodSource -> f VodSource
vodSource_arn = (VodSource -> Text)
-> (VodSource -> Text -> VodSource)
-> Lens VodSource VodSource Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\VodSource' {Text
arn :: Text
$sel:arn:VodSource' :: VodSource -> Text
arn} -> Text
arn) (\s :: VodSource
s@VodSource' {} Text
a -> VodSource
s {$sel:arn:VodSource' :: Text
arn = Text
a} :: VodSource)
instance Core.FromJSON VodSource where
parseJSON :: Value -> Parser VodSource
parseJSON =
String -> (Object -> Parser VodSource) -> Value -> Parser VodSource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"VodSource"
( \Object
x ->
Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> [HttpPackageConfiguration]
-> Text
-> VodSource
VodSource'
(Maybe POSIX
-> Maybe POSIX
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> [HttpPackageConfiguration]
-> Text
-> VodSource)
-> Parser (Maybe POSIX)
-> Parser
(Maybe POSIX
-> Maybe (HashMap Text Text)
-> Text
-> Text
-> [HttpPackageConfiguration]
-> Text
-> VodSource)
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 (HashMap Text Text)
-> Text
-> Text
-> [HttpPackageConfiguration]
-> Text
-> VodSource)
-> Parser (Maybe POSIX)
-> Parser
(Maybe (HashMap Text Text)
-> Text -> Text -> [HttpPackageConfiguration] -> Text -> VodSource)
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 (HashMap Text Text)
-> Text -> Text -> [HttpPackageConfiguration] -> Text -> VodSource)
-> Parser (Maybe (HashMap Text Text))
-> Parser
(Text -> Text -> [HttpPackageConfiguration] -> Text -> VodSource)
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 -> [HttpPackageConfiguration] -> Text -> VodSource)
-> Parser Text
-> Parser (Text -> [HttpPackageConfiguration] -> Text -> VodSource)
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 -> [HttpPackageConfiguration] -> Text -> VodSource)
-> Parser Text
-> Parser ([HttpPackageConfiguration] -> Text -> VodSource)
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 ([HttpPackageConfiguration] -> Text -> VodSource)
-> Parser [HttpPackageConfiguration] -> Parser (Text -> VodSource)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe [HttpPackageConfiguration])
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"HttpPackageConfigurations"
Parser (Maybe [HttpPackageConfiguration])
-> [HttpPackageConfiguration] -> Parser [HttpPackageConfiguration]
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= [HttpPackageConfiguration]
forall a. Monoid a => a
Prelude.mempty
)
Parser (Text -> VodSource) -> Parser Text -> Parser VodSource
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")
)
instance Prelude.Hashable VodSource
instance Prelude.NFData VodSource