{-# 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.MediaLive.Types.MultiplexProgramServiceDescriptor 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 MultiplexProgramServiceDescriptor = MultiplexProgramServiceDescriptor'
{
MultiplexProgramServiceDescriptor -> Text
providerName :: Prelude.Text,
MultiplexProgramServiceDescriptor -> Text
serviceName :: Prelude.Text
}
deriving (MultiplexProgramServiceDescriptor
-> MultiplexProgramServiceDescriptor -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MultiplexProgramServiceDescriptor
-> MultiplexProgramServiceDescriptor -> Bool
$c/= :: MultiplexProgramServiceDescriptor
-> MultiplexProgramServiceDescriptor -> Bool
== :: MultiplexProgramServiceDescriptor
-> MultiplexProgramServiceDescriptor -> Bool
$c== :: MultiplexProgramServiceDescriptor
-> MultiplexProgramServiceDescriptor -> Bool
Prelude.Eq, ReadPrec [MultiplexProgramServiceDescriptor]
ReadPrec MultiplexProgramServiceDescriptor
Int -> ReadS MultiplexProgramServiceDescriptor
ReadS [MultiplexProgramServiceDescriptor]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MultiplexProgramServiceDescriptor]
$creadListPrec :: ReadPrec [MultiplexProgramServiceDescriptor]
readPrec :: ReadPrec MultiplexProgramServiceDescriptor
$creadPrec :: ReadPrec MultiplexProgramServiceDescriptor
readList :: ReadS [MultiplexProgramServiceDescriptor]
$creadList :: ReadS [MultiplexProgramServiceDescriptor]
readsPrec :: Int -> ReadS MultiplexProgramServiceDescriptor
$creadsPrec :: Int -> ReadS MultiplexProgramServiceDescriptor
Prelude.Read, Int -> MultiplexProgramServiceDescriptor -> ShowS
[MultiplexProgramServiceDescriptor] -> ShowS
MultiplexProgramServiceDescriptor -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MultiplexProgramServiceDescriptor] -> ShowS
$cshowList :: [MultiplexProgramServiceDescriptor] -> ShowS
show :: MultiplexProgramServiceDescriptor -> String
$cshow :: MultiplexProgramServiceDescriptor -> String
showsPrec :: Int -> MultiplexProgramServiceDescriptor -> ShowS
$cshowsPrec :: Int -> MultiplexProgramServiceDescriptor -> ShowS
Prelude.Show, forall x.
Rep MultiplexProgramServiceDescriptor x
-> MultiplexProgramServiceDescriptor
forall x.
MultiplexProgramServiceDescriptor
-> Rep MultiplexProgramServiceDescriptor x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MultiplexProgramServiceDescriptor x
-> MultiplexProgramServiceDescriptor
$cfrom :: forall x.
MultiplexProgramServiceDescriptor
-> Rep MultiplexProgramServiceDescriptor x
Prelude.Generic)
newMultiplexProgramServiceDescriptor ::
Prelude.Text ->
Prelude.Text ->
MultiplexProgramServiceDescriptor
newMultiplexProgramServiceDescriptor :: Text -> Text -> MultiplexProgramServiceDescriptor
newMultiplexProgramServiceDescriptor
Text
pProviderName_
Text
pServiceName_ =
MultiplexProgramServiceDescriptor'
{ $sel:providerName:MultiplexProgramServiceDescriptor' :: Text
providerName =
Text
pProviderName_,
$sel:serviceName:MultiplexProgramServiceDescriptor' :: Text
serviceName = Text
pServiceName_
}
multiplexProgramServiceDescriptor_providerName :: Lens.Lens' MultiplexProgramServiceDescriptor Prelude.Text
multiplexProgramServiceDescriptor_providerName :: Lens' MultiplexProgramServiceDescriptor Text
multiplexProgramServiceDescriptor_providerName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexProgramServiceDescriptor' {Text
providerName :: Text
$sel:providerName:MultiplexProgramServiceDescriptor' :: MultiplexProgramServiceDescriptor -> Text
providerName} -> Text
providerName) (\s :: MultiplexProgramServiceDescriptor
s@MultiplexProgramServiceDescriptor' {} Text
a -> MultiplexProgramServiceDescriptor
s {$sel:providerName:MultiplexProgramServiceDescriptor' :: Text
providerName = Text
a} :: MultiplexProgramServiceDescriptor)
multiplexProgramServiceDescriptor_serviceName :: Lens.Lens' MultiplexProgramServiceDescriptor Prelude.Text
multiplexProgramServiceDescriptor_serviceName :: Lens' MultiplexProgramServiceDescriptor Text
multiplexProgramServiceDescriptor_serviceName = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexProgramServiceDescriptor' {Text
serviceName :: Text
$sel:serviceName:MultiplexProgramServiceDescriptor' :: MultiplexProgramServiceDescriptor -> Text
serviceName} -> Text
serviceName) (\s :: MultiplexProgramServiceDescriptor
s@MultiplexProgramServiceDescriptor' {} Text
a -> MultiplexProgramServiceDescriptor
s {$sel:serviceName:MultiplexProgramServiceDescriptor' :: Text
serviceName = Text
a} :: MultiplexProgramServiceDescriptor)
instance
Data.FromJSON
MultiplexProgramServiceDescriptor
where
parseJSON :: Value -> Parser MultiplexProgramServiceDescriptor
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"MultiplexProgramServiceDescriptor"
( \Object
x ->
Text -> Text -> MultiplexProgramServiceDescriptor
MultiplexProgramServiceDescriptor'
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"providerName")
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"serviceName")
)
instance
Prelude.Hashable
MultiplexProgramServiceDescriptor
where
hashWithSalt :: Int -> MultiplexProgramServiceDescriptor -> Int
hashWithSalt
Int
_salt
MultiplexProgramServiceDescriptor' {Text
serviceName :: Text
providerName :: Text
$sel:serviceName:MultiplexProgramServiceDescriptor' :: MultiplexProgramServiceDescriptor -> Text
$sel:providerName:MultiplexProgramServiceDescriptor' :: MultiplexProgramServiceDescriptor -> Text
..} =
Int
_salt
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
providerName
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
serviceName
instance
Prelude.NFData
MultiplexProgramServiceDescriptor
where
rnf :: MultiplexProgramServiceDescriptor -> ()
rnf MultiplexProgramServiceDescriptor' {Text
serviceName :: Text
providerName :: Text
$sel:serviceName:MultiplexProgramServiceDescriptor' :: MultiplexProgramServiceDescriptor -> Text
$sel:providerName:MultiplexProgramServiceDescriptor' :: MultiplexProgramServiceDescriptor -> Text
..} =
forall a. NFData a => a -> ()
Prelude.rnf Text
providerName
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Text
serviceName
instance
Data.ToJSON
MultiplexProgramServiceDescriptor
where
toJSON :: MultiplexProgramServiceDescriptor -> Value
toJSON MultiplexProgramServiceDescriptor' {Text
serviceName :: Text
providerName :: Text
$sel:serviceName:MultiplexProgramServiceDescriptor' :: MultiplexProgramServiceDescriptor -> Text
$sel:providerName:MultiplexProgramServiceDescriptor' :: MultiplexProgramServiceDescriptor -> Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ forall a. a -> Maybe a
Prelude.Just (Key
"providerName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
providerName),
forall a. a -> Maybe a
Prelude.Just (Key
"serviceName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= Text
serviceName)
]
)