{-# 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.SlateSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data SlateSource = SlateSource'
{
SlateSource -> Maybe Text
sourceLocationName :: Prelude.Maybe Prelude.Text,
SlateSource -> Maybe Text
vodSourceName :: Prelude.Maybe Prelude.Text
}
deriving (SlateSource -> SlateSource -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SlateSource -> SlateSource -> Bool
$c/= :: SlateSource -> SlateSource -> Bool
== :: SlateSource -> SlateSource -> Bool
$c== :: SlateSource -> SlateSource -> Bool
Prelude.Eq, ReadPrec [SlateSource]
ReadPrec SlateSource
Int -> ReadS SlateSource
ReadS [SlateSource]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SlateSource]
$creadListPrec :: ReadPrec [SlateSource]
readPrec :: ReadPrec SlateSource
$creadPrec :: ReadPrec SlateSource
readList :: ReadS [SlateSource]
$creadList :: ReadS [SlateSource]
readsPrec :: Int -> ReadS SlateSource
$creadsPrec :: Int -> ReadS SlateSource
Prelude.Read, Int -> SlateSource -> ShowS
[SlateSource] -> ShowS
SlateSource -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SlateSource] -> ShowS
$cshowList :: [SlateSource] -> ShowS
show :: SlateSource -> String
$cshow :: SlateSource -> String
showsPrec :: Int -> SlateSource -> ShowS
$cshowsPrec :: Int -> SlateSource -> ShowS
Prelude.Show, forall x. Rep SlateSource x -> SlateSource
forall x. SlateSource -> Rep SlateSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SlateSource x -> SlateSource
$cfrom :: forall x. SlateSource -> Rep SlateSource x
Prelude.Generic)
newSlateSource ::
SlateSource
newSlateSource :: SlateSource
newSlateSource =
SlateSource'
{ $sel:sourceLocationName:SlateSource' :: Maybe Text
sourceLocationName = forall a. Maybe a
Prelude.Nothing,
$sel:vodSourceName:SlateSource' :: Maybe Text
vodSourceName = forall a. Maybe a
Prelude.Nothing
}
slateSource_sourceLocationName :: Lens.Lens' SlateSource (Prelude.Maybe Prelude.Text)
slateSource_sourceLocationName :: Lens' SlateSource (Maybe Text)
slateSource_sourceLocationName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlateSource' {Maybe Text
sourceLocationName :: Maybe Text
$sel:sourceLocationName:SlateSource' :: SlateSource -> Maybe Text
sourceLocationName} -> Maybe Text
sourceLocationName) (\s :: SlateSource
s@SlateSource' {} Maybe Text
a -> SlateSource
s {$sel:sourceLocationName:SlateSource' :: Maybe Text
sourceLocationName = Maybe Text
a} :: SlateSource)
slateSource_vodSourceName :: Lens.Lens' SlateSource (Prelude.Maybe Prelude.Text)
slateSource_vodSourceName :: Lens' SlateSource (Maybe Text)
slateSource_vodSourceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SlateSource' {Maybe Text
vodSourceName :: Maybe Text
$sel:vodSourceName:SlateSource' :: SlateSource -> Maybe Text
vodSourceName} -> Maybe Text
vodSourceName) (\s :: SlateSource
s@SlateSource' {} Maybe Text
a -> SlateSource
s {$sel:vodSourceName:SlateSource' :: Maybe Text
vodSourceName = Maybe Text
a} :: SlateSource)
instance Data.FromJSON SlateSource where
parseJSON :: Value -> Parser SlateSource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SlateSource"
( \Object
x ->
Maybe Text -> Maybe Text -> SlateSource
SlateSource'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"SourceLocationName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"VodSourceName")
)
instance Prelude.Hashable SlateSource where
hashWithSalt :: Int -> SlateSource -> Int
hashWithSalt Int
_salt SlateSource' {Maybe Text
vodSourceName :: Maybe Text
sourceLocationName :: Maybe Text
$sel:vodSourceName:SlateSource' :: SlateSource -> Maybe Text
$sel:sourceLocationName:SlateSource' :: SlateSource -> Maybe Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
sourceLocationName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
vodSourceName
instance Prelude.NFData SlateSource where
rnf :: SlateSource -> ()
rnf SlateSource' {Maybe Text
vodSourceName :: Maybe Text
sourceLocationName :: Maybe Text
$sel:vodSourceName:SlateSource' :: SlateSource -> Maybe Text
$sel:sourceLocationName:SlateSource' :: SlateSource -> Maybe Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
sourceLocationName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
vodSourceName
instance Data.ToJSON SlateSource where
toJSON :: SlateSource -> Value
toJSON SlateSource' {Maybe Text
vodSourceName :: Maybe Text
sourceLocationName :: Maybe Text
$sel:vodSourceName:SlateSource' :: SlateSource -> Maybe Text
$sel:sourceLocationName:SlateSource' :: SlateSource -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"SourceLocationName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
sourceLocationName,
(Key
"VodSourceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
vodSourceName
]
)