{-# 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.InputSource where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude
data InputSource = InputSource'
{
InputSource -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
InputSource -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
InputSource -> Maybe Text
passwordParam :: Prelude.Maybe Prelude.Text
}
deriving (InputSource -> InputSource -> Bool
(InputSource -> InputSource -> Bool)
-> (InputSource -> InputSource -> Bool) -> Eq InputSource
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputSource -> InputSource -> Bool
$c/= :: InputSource -> InputSource -> Bool
== :: InputSource -> InputSource -> Bool
$c== :: InputSource -> InputSource -> Bool
Prelude.Eq, ReadPrec [InputSource]
ReadPrec InputSource
Int -> ReadS InputSource
ReadS [InputSource]
(Int -> ReadS InputSource)
-> ReadS [InputSource]
-> ReadPrec InputSource
-> ReadPrec [InputSource]
-> Read InputSource
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputSource]
$creadListPrec :: ReadPrec [InputSource]
readPrec :: ReadPrec InputSource
$creadPrec :: ReadPrec InputSource
readList :: ReadS [InputSource]
$creadList :: ReadS [InputSource]
readsPrec :: Int -> ReadS InputSource
$creadsPrec :: Int -> ReadS InputSource
Prelude.Read, Int -> InputSource -> ShowS
[InputSource] -> ShowS
InputSource -> String
(Int -> InputSource -> ShowS)
-> (InputSource -> String)
-> ([InputSource] -> ShowS)
-> Show InputSource
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputSource] -> ShowS
$cshowList :: [InputSource] -> ShowS
show :: InputSource -> String
$cshow :: InputSource -> String
showsPrec :: Int -> InputSource -> ShowS
$cshowsPrec :: Int -> InputSource -> ShowS
Prelude.Show, (forall x. InputSource -> Rep InputSource x)
-> (forall x. Rep InputSource x -> InputSource)
-> Generic InputSource
forall x. Rep InputSource x -> InputSource
forall x. InputSource -> Rep InputSource x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputSource x -> InputSource
$cfrom :: forall x. InputSource -> Rep InputSource x
Prelude.Generic)
newInputSource ::
InputSource
newInputSource :: InputSource
newInputSource =
InputSource' :: Maybe Text -> Maybe Text -> Maybe Text -> InputSource
InputSource'
{ $sel:url:InputSource' :: Maybe Text
url = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:username:InputSource' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
$sel:passwordParam:InputSource' :: Maybe Text
passwordParam = Maybe Text
forall a. Maybe a
Prelude.Nothing
}
inputSource_url :: Lens.Lens' InputSource (Prelude.Maybe Prelude.Text)
inputSource_url :: (Maybe Text -> f (Maybe Text)) -> InputSource -> f InputSource
inputSource_url = (InputSource -> Maybe Text)
-> (InputSource -> Maybe Text -> InputSource)
-> Lens InputSource InputSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSource' {Maybe Text
url :: Maybe Text
$sel:url:InputSource' :: InputSource -> Maybe Text
url} -> Maybe Text
url) (\s :: InputSource
s@InputSource' {} Maybe Text
a -> InputSource
s {$sel:url:InputSource' :: Maybe Text
url = Maybe Text
a} :: InputSource)
inputSource_username :: Lens.Lens' InputSource (Prelude.Maybe Prelude.Text)
inputSource_username :: (Maybe Text -> f (Maybe Text)) -> InputSource -> f InputSource
inputSource_username = (InputSource -> Maybe Text)
-> (InputSource -> Maybe Text -> InputSource)
-> Lens InputSource InputSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSource' {Maybe Text
username :: Maybe Text
$sel:username:InputSource' :: InputSource -> Maybe Text
username} -> Maybe Text
username) (\s :: InputSource
s@InputSource' {} Maybe Text
a -> InputSource
s {$sel:username:InputSource' :: Maybe Text
username = Maybe Text
a} :: InputSource)
inputSource_passwordParam :: Lens.Lens' InputSource (Prelude.Maybe Prelude.Text)
inputSource_passwordParam :: (Maybe Text -> f (Maybe Text)) -> InputSource -> f InputSource
inputSource_passwordParam = (InputSource -> Maybe Text)
-> (InputSource -> Maybe Text -> InputSource)
-> Lens InputSource InputSource (Maybe Text) (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputSource' {Maybe Text
passwordParam :: Maybe Text
$sel:passwordParam:InputSource' :: InputSource -> Maybe Text
passwordParam} -> Maybe Text
passwordParam) (\s :: InputSource
s@InputSource' {} Maybe Text
a -> InputSource
s {$sel:passwordParam:InputSource' :: Maybe Text
passwordParam = Maybe Text
a} :: InputSource)
instance Core.FromJSON InputSource where
parseJSON :: Value -> Parser InputSource
parseJSON =
String
-> (Object -> Parser InputSource) -> Value -> Parser InputSource
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InputSource"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> InputSource
InputSource'
(Maybe Text -> Maybe Text -> Maybe Text -> InputSource)
-> Parser (Maybe Text)
-> Parser (Maybe Text -> Maybe Text -> InputSource)
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 -> InputSource)
-> Parser (Maybe Text) -> Parser (Maybe Text -> InputSource)
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 -> InputSource)
-> Parser (Maybe Text) -> Parser InputSource
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")
)
instance Prelude.Hashable InputSource
instance Prelude.NFData InputSource