{-# 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.MediaConnect.Types.SourcePriority 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 SourcePriority = SourcePriority'
{
SourcePriority -> Maybe Text
primarySource :: Prelude.Maybe Prelude.Text
}
deriving (SourcePriority -> SourcePriority -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: SourcePriority -> SourcePriority -> Bool
$c/= :: SourcePriority -> SourcePriority -> Bool
== :: SourcePriority -> SourcePriority -> Bool
$c== :: SourcePriority -> SourcePriority -> Bool
Prelude.Eq, ReadPrec [SourcePriority]
ReadPrec SourcePriority
Int -> ReadS SourcePriority
ReadS [SourcePriority]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [SourcePriority]
$creadListPrec :: ReadPrec [SourcePriority]
readPrec :: ReadPrec SourcePriority
$creadPrec :: ReadPrec SourcePriority
readList :: ReadS [SourcePriority]
$creadList :: ReadS [SourcePriority]
readsPrec :: Int -> ReadS SourcePriority
$creadsPrec :: Int -> ReadS SourcePriority
Prelude.Read, Int -> SourcePriority -> ShowS
[SourcePriority] -> ShowS
SourcePriority -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [SourcePriority] -> ShowS
$cshowList :: [SourcePriority] -> ShowS
show :: SourcePriority -> String
$cshow :: SourcePriority -> String
showsPrec :: Int -> SourcePriority -> ShowS
$cshowsPrec :: Int -> SourcePriority -> ShowS
Prelude.Show, forall x. Rep SourcePriority x -> SourcePriority
forall x. SourcePriority -> Rep SourcePriority x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep SourcePriority x -> SourcePriority
$cfrom :: forall x. SourcePriority -> Rep SourcePriority x
Prelude.Generic)
newSourcePriority ::
SourcePriority
newSourcePriority :: SourcePriority
newSourcePriority =
SourcePriority' {$sel:primarySource:SourcePriority' :: Maybe Text
primarySource = forall a. Maybe a
Prelude.Nothing}
sourcePriority_primarySource :: Lens.Lens' SourcePriority (Prelude.Maybe Prelude.Text)
sourcePriority_primarySource :: Lens' SourcePriority (Maybe Text)
sourcePriority_primarySource = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\SourcePriority' {Maybe Text
primarySource :: Maybe Text
$sel:primarySource:SourcePriority' :: SourcePriority -> Maybe Text
primarySource} -> Maybe Text
primarySource) (\s :: SourcePriority
s@SourcePriority' {} Maybe Text
a -> SourcePriority
s {$sel:primarySource:SourcePriority' :: Maybe Text
primarySource = Maybe Text
a} :: SourcePriority)
instance Data.FromJSON SourcePriority where
parseJSON :: Value -> Parser SourcePriority
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"SourcePriority"
( \Object
x ->
Maybe Text -> SourcePriority
SourcePriority'
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
"primarySource")
)
instance Prelude.Hashable SourcePriority where
hashWithSalt :: Int -> SourcePriority -> Int
hashWithSalt Int
_salt SourcePriority' {Maybe Text
primarySource :: Maybe Text
$sel:primarySource:SourcePriority' :: SourcePriority -> Maybe Text
..} =
Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
primarySource
instance Prelude.NFData SourcePriority where
rnf :: SourcePriority -> ()
rnf SourcePriority' {Maybe Text
primarySource :: Maybe Text
$sel:primarySource:SourcePriority' :: SourcePriority -> Maybe Text
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
primarySource
instance Data.ToJSON SourcePriority where
toJSON :: SourcePriority -> Value
toJSON SourcePriority' {Maybe Text
primarySource :: Maybe Text
$sel:primarySource:SourcePriority' :: SourcePriority -> Maybe Text
..} =
[Pair] -> Value
Data.object
( forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Key
"primarySource" 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
primarySource
]
)