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