{-# 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.NetworkInputSettings where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.HlsInputSettings
import Amazonka.MediaLive.Types.NetworkInputServerValidation
import qualified Amazonka.Prelude as Prelude
data NetworkInputSettings = NetworkInputSettings'
{
NetworkInputSettings -> Maybe HlsInputSettings
hlsInputSettings :: Prelude.Maybe HlsInputSettings,
NetworkInputSettings -> Maybe NetworkInputServerValidation
serverValidation :: Prelude.Maybe NetworkInputServerValidation
}
deriving (NetworkInputSettings -> NetworkInputSettings -> Bool
(NetworkInputSettings -> NetworkInputSettings -> Bool)
-> (NetworkInputSettings -> NetworkInputSettings -> Bool)
-> Eq NetworkInputSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NetworkInputSettings -> NetworkInputSettings -> Bool
$c/= :: NetworkInputSettings -> NetworkInputSettings -> Bool
== :: NetworkInputSettings -> NetworkInputSettings -> Bool
$c== :: NetworkInputSettings -> NetworkInputSettings -> Bool
Prelude.Eq, ReadPrec [NetworkInputSettings]
ReadPrec NetworkInputSettings
Int -> ReadS NetworkInputSettings
ReadS [NetworkInputSettings]
(Int -> ReadS NetworkInputSettings)
-> ReadS [NetworkInputSettings]
-> ReadPrec NetworkInputSettings
-> ReadPrec [NetworkInputSettings]
-> Read NetworkInputSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [NetworkInputSettings]
$creadListPrec :: ReadPrec [NetworkInputSettings]
readPrec :: ReadPrec NetworkInputSettings
$creadPrec :: ReadPrec NetworkInputSettings
readList :: ReadS [NetworkInputSettings]
$creadList :: ReadS [NetworkInputSettings]
readsPrec :: Int -> ReadS NetworkInputSettings
$creadsPrec :: Int -> ReadS NetworkInputSettings
Prelude.Read, Int -> NetworkInputSettings -> ShowS
[NetworkInputSettings] -> ShowS
NetworkInputSettings -> String
(Int -> NetworkInputSettings -> ShowS)
-> (NetworkInputSettings -> String)
-> ([NetworkInputSettings] -> ShowS)
-> Show NetworkInputSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NetworkInputSettings] -> ShowS
$cshowList :: [NetworkInputSettings] -> ShowS
show :: NetworkInputSettings -> String
$cshow :: NetworkInputSettings -> String
showsPrec :: Int -> NetworkInputSettings -> ShowS
$cshowsPrec :: Int -> NetworkInputSettings -> ShowS
Prelude.Show, (forall x. NetworkInputSettings -> Rep NetworkInputSettings x)
-> (forall x. Rep NetworkInputSettings x -> NetworkInputSettings)
-> Generic NetworkInputSettings
forall x. Rep NetworkInputSettings x -> NetworkInputSettings
forall x. NetworkInputSettings -> Rep NetworkInputSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep NetworkInputSettings x -> NetworkInputSettings
$cfrom :: forall x. NetworkInputSettings -> Rep NetworkInputSettings x
Prelude.Generic)
newNetworkInputSettings ::
NetworkInputSettings
newNetworkInputSettings :: NetworkInputSettings
newNetworkInputSettings =
NetworkInputSettings' :: Maybe HlsInputSettings
-> Maybe NetworkInputServerValidation -> NetworkInputSettings
NetworkInputSettings'
{ $sel:hlsInputSettings:NetworkInputSettings' :: Maybe HlsInputSettings
hlsInputSettings =
Maybe HlsInputSettings
forall a. Maybe a
Prelude.Nothing,
$sel:serverValidation:NetworkInputSettings' :: Maybe NetworkInputServerValidation
serverValidation = Maybe NetworkInputServerValidation
forall a. Maybe a
Prelude.Nothing
}
networkInputSettings_hlsInputSettings :: Lens.Lens' NetworkInputSettings (Prelude.Maybe HlsInputSettings)
networkInputSettings_hlsInputSettings :: (Maybe HlsInputSettings -> f (Maybe HlsInputSettings))
-> NetworkInputSettings -> f NetworkInputSettings
networkInputSettings_hlsInputSettings = (NetworkInputSettings -> Maybe HlsInputSettings)
-> (NetworkInputSettings
-> Maybe HlsInputSettings -> NetworkInputSettings)
-> Lens
NetworkInputSettings
NetworkInputSettings
(Maybe HlsInputSettings)
(Maybe HlsInputSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInputSettings' {Maybe HlsInputSettings
hlsInputSettings :: Maybe HlsInputSettings
$sel:hlsInputSettings:NetworkInputSettings' :: NetworkInputSettings -> Maybe HlsInputSettings
hlsInputSettings} -> Maybe HlsInputSettings
hlsInputSettings) (\s :: NetworkInputSettings
s@NetworkInputSettings' {} Maybe HlsInputSettings
a -> NetworkInputSettings
s {$sel:hlsInputSettings:NetworkInputSettings' :: Maybe HlsInputSettings
hlsInputSettings = Maybe HlsInputSettings
a} :: NetworkInputSettings)
networkInputSettings_serverValidation :: Lens.Lens' NetworkInputSettings (Prelude.Maybe NetworkInputServerValidation)
networkInputSettings_serverValidation :: (Maybe NetworkInputServerValidation
-> f (Maybe NetworkInputServerValidation))
-> NetworkInputSettings -> f NetworkInputSettings
networkInputSettings_serverValidation = (NetworkInputSettings -> Maybe NetworkInputServerValidation)
-> (NetworkInputSettings
-> Maybe NetworkInputServerValidation -> NetworkInputSettings)
-> Lens
NetworkInputSettings
NetworkInputSettings
(Maybe NetworkInputServerValidation)
(Maybe NetworkInputServerValidation)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\NetworkInputSettings' {Maybe NetworkInputServerValidation
serverValidation :: Maybe NetworkInputServerValidation
$sel:serverValidation:NetworkInputSettings' :: NetworkInputSettings -> Maybe NetworkInputServerValidation
serverValidation} -> Maybe NetworkInputServerValidation
serverValidation) (\s :: NetworkInputSettings
s@NetworkInputSettings' {} Maybe NetworkInputServerValidation
a -> NetworkInputSettings
s {$sel:serverValidation:NetworkInputSettings' :: Maybe NetworkInputServerValidation
serverValidation = Maybe NetworkInputServerValidation
a} :: NetworkInputSettings)
instance Core.FromJSON NetworkInputSettings where
parseJSON :: Value -> Parser NetworkInputSettings
parseJSON =
String
-> (Object -> Parser NetworkInputSettings)
-> Value
-> Parser NetworkInputSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"NetworkInputSettings"
( \Object
x ->
Maybe HlsInputSettings
-> Maybe NetworkInputServerValidation -> NetworkInputSettings
NetworkInputSettings'
(Maybe HlsInputSettings
-> Maybe NetworkInputServerValidation -> NetworkInputSettings)
-> Parser (Maybe HlsInputSettings)
-> Parser
(Maybe NetworkInputServerValidation -> NetworkInputSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe HlsInputSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"hlsInputSettings")
Parser (Maybe NetworkInputServerValidation -> NetworkInputSettings)
-> Parser (Maybe NetworkInputServerValidation)
-> Parser NetworkInputSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe NetworkInputServerValidation)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"serverValidation")
)
instance Prelude.Hashable NetworkInputSettings
instance Prelude.NFData NetworkInputSettings
instance Core.ToJSON NetworkInputSettings where
toJSON :: NetworkInputSettings -> Value
toJSON NetworkInputSettings' {Maybe HlsInputSettings
Maybe NetworkInputServerValidation
serverValidation :: Maybe NetworkInputServerValidation
hlsInputSettings :: Maybe HlsInputSettings
$sel:serverValidation:NetworkInputSettings' :: NetworkInputSettings -> Maybe NetworkInputServerValidation
$sel:hlsInputSettings:NetworkInputSettings' :: NetworkInputSettings -> Maybe HlsInputSettings
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ (Text
"hlsInputSettings" Text -> HlsInputSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(HlsInputSettings -> Pair) -> Maybe HlsInputSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe HlsInputSettings
hlsInputSettings,
(Text
"serverValidation" Text -> NetworkInputServerValidation -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
(NetworkInputServerValidation -> Pair)
-> Maybe NetworkInputServerValidation -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe NetworkInputServerValidation
serverValidation
]
)