{-# 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.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data OutputDestinationSettings = OutputDestinationSettings'
{
OutputDestinationSettings -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
OutputDestinationSettings -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
OutputDestinationSettings -> Maybe Text
passwordParam :: Prelude.Maybe Prelude.Text,
OutputDestinationSettings -> Maybe Text
streamName :: Prelude.Maybe Prelude.Text
}
deriving (OutputDestinationSettings -> OutputDestinationSettings -> Bool
(OutputDestinationSettings -> OutputDestinationSettings -> Bool)
-> (OutputDestinationSettings -> OutputDestinationSettings -> Bool)
-> Eq OutputDestinationSettings
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]
(Int -> ReadS OutputDestinationSettings)
-> ReadS [OutputDestinationSettings]
-> ReadPrec OutputDestinationSettings
-> ReadPrec [OutputDestinationSettings]
-> Read 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
(Int -> OutputDestinationSettings -> ShowS)
-> (OutputDestinationSettings -> String)
-> ([OutputDestinationSettings] -> ShowS)
-> Show OutputDestinationSettings
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.
OutputDestinationSettings -> Rep OutputDestinationSettings x)
-> (forall x.
Rep OutputDestinationSettings x -> OutputDestinationSettings)
-> Generic OutputDestinationSettings
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' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OutputDestinationSettings
OutputDestinationSettings'
{ $sel:url:OutputDestinationSettings' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:username:OutputDestinationSettings' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:passwordParam:OutputDestinationSettings' :: Maybe Text
passwordParam = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:streamName:OutputDestinationSettings' :: Maybe Text
streamName = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
outputDestinationSettings_url :: Lens.Lens' OutputDestinationSettings (Prelude.Maybe Prelude.Text)
outputDestinationSettings_url :: (Maybe Text -> f (Maybe Text))
-> OutputDestinationSettings -> f OutputDestinationSettings
outputDestinationSettings_url = (OutputDestinationSettings -> Maybe Text)
-> (OutputDestinationSettings
-> Maybe Text -> OutputDestinationSettings)
-> Lens
OutputDestinationSettings
OutputDestinationSettings
(Maybe Text)
(Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> OutputDestinationSettings -> f OutputDestinationSettings
outputDestinationSettings_username = (OutputDestinationSettings -> Maybe Text)
-> (OutputDestinationSettings
-> Maybe Text -> OutputDestinationSettings)
-> Lens
OutputDestinationSettings
OutputDestinationSettings
(Maybe Text)
(Maybe Text)
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)
outputDestinationSettings_passwordParam :: Lens.Lens' OutputDestinationSettings (Prelude.Maybe Prelude.Text)
outputDestinationSettings_passwordParam :: (Maybe Text -> f (Maybe Text))
-> OutputDestinationSettings -> f OutputDestinationSettings
outputDestinationSettings_passwordParam = (OutputDestinationSettings -> Maybe Text)
-> (OutputDestinationSettings
-> Maybe Text -> OutputDestinationSettings)
-> Lens
OutputDestinationSettings
OutputDestinationSettings
(Maybe Text)
(Maybe Text)
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 :: (Maybe Text -> f (Maybe Text))
-> OutputDestinationSettings -> f OutputDestinationSettings
outputDestinationSettings_streamName = (OutputDestinationSettings -> Maybe Text)
-> (OutputDestinationSettings
-> Maybe Text -> OutputDestinationSettings)
-> Lens
OutputDestinationSettings
OutputDestinationSettings
(Maybe Text)
(Maybe Text)
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)
instance Core.FromJSON OutputDestinationSettings where
parseJSON :: Value -> Parser OutputDestinationSettings
parseJSON =
String
-> (Object -> Parser OutputDestinationSettings)
-> Value
-> Parser OutputDestinationSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"OutputDestinationSettings"
( \Object
x ->
Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OutputDestinationSettings
OutputDestinationSettings'
(Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> OutputDestinationSettings)
-> Parser (Maybe Text)
-> Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> OutputDestinationSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"url")
Parser
(Maybe Text
-> Maybe Text -> Maybe Text -> OutputDestinationSettings)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> OutputDestinationSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"username")
Parser (Maybe Text -> Maybe Text -> OutputDestinationSettings)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> OutputDestinationSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"passwordParam")
Parser (Maybe Text -> OutputDestinationSettings)
-> Parser (Maybe Text) -> Parser OutputDestinationSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"streamName")
)
instance Prelude.Hashable OutputDestinationSettings
instance Prelude.NFData OutputDestinationSettings
instance Core.ToJSON OutputDestinationSettings where
toJSON :: OutputDestinationSettings -> Value
toJSON OutputDestinationSettings' {Maybe Text
streamName :: Maybe Text
passwordParam :: Maybe Text
username :: Maybe Text
url :: Maybe Text
$sel:streamName:OutputDestinationSettings' :: OutputDestinationSettings -> Maybe Text
$sel:passwordParam:OutputDestinationSettings' :: OutputDestinationSettings -> Maybe Text
$sel:username:OutputDestinationSettings' :: OutputDestinationSettings -> Maybe Text
$sel:url:OutputDestinationSettings' :: OutputDestinationSettings -> Maybe Text
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"url" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
url,
(Text
"username" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
username,
(Text
"passwordParam" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
passwordParam,
(Text
"streamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
streamName
]
)