{-# 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.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import qualified Amazonka.Prelude as Prelude
data InputSource = InputSource'
{
InputSource -> Maybe Text
passwordParam :: Prelude.Maybe Prelude.Text,
InputSource -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
InputSource -> Maybe Text
username :: Prelude.Maybe Prelude.Text
}
deriving (InputSource -> InputSource -> Bool
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]
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
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. 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'
{ $sel:passwordParam:InputSource' :: Maybe Text
passwordParam = forall a. Maybe a
Prelude.Nothing,
$sel:url:InputSource' :: Maybe Text
url = forall a. Maybe a
Prelude.Nothing,
$sel:username:InputSource' :: Maybe Text
username = forall a. Maybe a
Prelude.Nothing
}
inputSource_passwordParam :: Lens.Lens' InputSource (Prelude.Maybe Prelude.Text)
inputSource_passwordParam :: Lens' InputSource (Maybe Text)
inputSource_passwordParam = 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)
inputSource_url :: Lens.Lens' InputSource (Prelude.Maybe Prelude.Text)
inputSource_url :: Lens' InputSource (Maybe Text)
inputSource_url = 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 :: Lens' InputSource (Maybe Text)
inputSource_username = 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)
instance Data.FromJSON InputSource where
parseJSON :: Value -> Parser InputSource
parseJSON =
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
String
"InputSource"
( \Object
x ->
Maybe Text -> Maybe Text -> Maybe Text -> InputSource
InputSource'
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
"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 InputSource where
hashWithSalt :: Int -> InputSource -> Int
hashWithSalt Int
_salt InputSource' {Maybe Text
username :: Maybe Text
url :: Maybe Text
passwordParam :: Maybe Text
$sel:username:InputSource' :: InputSource -> Maybe Text
$sel:url:InputSource' :: InputSource -> Maybe Text
$sel:passwordParam:InputSource' :: InputSource -> 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
url
forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
username
instance Prelude.NFData InputSource where
rnf :: InputSource -> ()
rnf InputSource' {Maybe Text
username :: Maybe Text
url :: Maybe Text
passwordParam :: Maybe Text
$sel:username:InputSource' :: InputSource -> Maybe Text
$sel:url:InputSource' :: InputSource -> Maybe Text
$sel:passwordParam:InputSource' :: InputSource -> 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
url
seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
username