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