{-# 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.MediaConnect.Types.InputConfiguration where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.Interface
import qualified Amazonka.Prelude as Prelude
data InputConfiguration = InputConfiguration'
{
InputConfiguration -> Int
inputPort :: Prelude.Int,
InputConfiguration -> Text
inputIp :: Prelude.Text,
InputConfiguration -> Interface
interface :: Interface
}
deriving (InputConfiguration -> InputConfiguration -> Bool
(InputConfiguration -> InputConfiguration -> Bool)
-> (InputConfiguration -> InputConfiguration -> Bool)
-> Eq InputConfiguration
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputConfiguration -> InputConfiguration -> Bool
$c/= :: InputConfiguration -> InputConfiguration -> Bool
== :: InputConfiguration -> InputConfiguration -> Bool
$c== :: InputConfiguration -> InputConfiguration -> Bool
Prelude.Eq, ReadPrec [InputConfiguration]
ReadPrec InputConfiguration
Int -> ReadS InputConfiguration
ReadS [InputConfiguration]
(Int -> ReadS InputConfiguration)
-> ReadS [InputConfiguration]
-> ReadPrec InputConfiguration
-> ReadPrec [InputConfiguration]
-> Read InputConfiguration
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputConfiguration]
$creadListPrec :: ReadPrec [InputConfiguration]
readPrec :: ReadPrec InputConfiguration
$creadPrec :: ReadPrec InputConfiguration
readList :: ReadS [InputConfiguration]
$creadList :: ReadS [InputConfiguration]
readsPrec :: Int -> ReadS InputConfiguration
$creadsPrec :: Int -> ReadS InputConfiguration
Prelude.Read, Int -> InputConfiguration -> ShowS
[InputConfiguration] -> ShowS
InputConfiguration -> String
(Int -> InputConfiguration -> ShowS)
-> (InputConfiguration -> String)
-> ([InputConfiguration] -> ShowS)
-> Show InputConfiguration
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputConfiguration] -> ShowS
$cshowList :: [InputConfiguration] -> ShowS
show :: InputConfiguration -> String
$cshow :: InputConfiguration -> String
showsPrec :: Int -> InputConfiguration -> ShowS
$cshowsPrec :: Int -> InputConfiguration -> ShowS
Prelude.Show, (forall x. InputConfiguration -> Rep InputConfiguration x)
-> (forall x. Rep InputConfiguration x -> InputConfiguration)
-> Generic InputConfiguration
forall x. Rep InputConfiguration x -> InputConfiguration
forall x. InputConfiguration -> Rep InputConfiguration x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep InputConfiguration x -> InputConfiguration
$cfrom :: forall x. InputConfiguration -> Rep InputConfiguration x
Prelude.Generic)
newInputConfiguration ::
Prelude.Int ->
Prelude.Text ->
Interface ->
InputConfiguration
newInputConfiguration :: Int -> Text -> Interface -> InputConfiguration
newInputConfiguration
Int
pInputPort_
Text
pInputIp_
Interface
pInterface_ =
InputConfiguration' :: Int -> Text -> Interface -> InputConfiguration
InputConfiguration'
{ $sel:inputPort:InputConfiguration' :: Int
inputPort = Int
pInputPort_,
$sel:inputIp:InputConfiguration' :: Text
inputIp = Text
pInputIp_,
$sel:interface:InputConfiguration' :: Interface
interface = Interface
pInterface_
}
inputConfiguration_inputPort :: Lens.Lens' InputConfiguration Prelude.Int
inputConfiguration_inputPort :: (Int -> f Int) -> InputConfiguration -> f InputConfiguration
inputConfiguration_inputPort = (InputConfiguration -> Int)
-> (InputConfiguration -> Int -> InputConfiguration)
-> Lens InputConfiguration InputConfiguration Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputConfiguration' {Int
inputPort :: Int
$sel:inputPort:InputConfiguration' :: InputConfiguration -> Int
inputPort} -> Int
inputPort) (\s :: InputConfiguration
s@InputConfiguration' {} Int
a -> InputConfiguration
s {$sel:inputPort:InputConfiguration' :: Int
inputPort = Int
a} :: InputConfiguration)
inputConfiguration_inputIp :: Lens.Lens' InputConfiguration Prelude.Text
inputConfiguration_inputIp :: (Text -> f Text) -> InputConfiguration -> f InputConfiguration
inputConfiguration_inputIp = (InputConfiguration -> Text)
-> (InputConfiguration -> Text -> InputConfiguration)
-> Lens InputConfiguration InputConfiguration Text Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputConfiguration' {Text
inputIp :: Text
$sel:inputIp:InputConfiguration' :: InputConfiguration -> Text
inputIp} -> Text
inputIp) (\s :: InputConfiguration
s@InputConfiguration' {} Text
a -> InputConfiguration
s {$sel:inputIp:InputConfiguration' :: Text
inputIp = Text
a} :: InputConfiguration)
inputConfiguration_interface :: Lens.Lens' InputConfiguration Interface
inputConfiguration_interface :: (Interface -> f Interface)
-> InputConfiguration -> f InputConfiguration
inputConfiguration_interface = (InputConfiguration -> Interface)
-> (InputConfiguration -> Interface -> InputConfiguration)
-> Lens InputConfiguration InputConfiguration Interface Interface
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputConfiguration' {Interface
interface :: Interface
$sel:interface:InputConfiguration' :: InputConfiguration -> Interface
interface} -> Interface
interface) (\s :: InputConfiguration
s@InputConfiguration' {} Interface
a -> InputConfiguration
s {$sel:interface:InputConfiguration' :: Interface
interface = Interface
a} :: InputConfiguration)
instance Core.FromJSON InputConfiguration where
parseJSON :: Value -> Parser InputConfiguration
parseJSON =
String
-> (Object -> Parser InputConfiguration)
-> Value
-> Parser InputConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
String
"InputConfiguration"
( \Object
x ->
Int -> Text -> Interface -> InputConfiguration
InputConfiguration'
(Int -> Text -> Interface -> InputConfiguration)
-> Parser Int -> Parser (Text -> Interface -> InputConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Int
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"inputPort")
Parser (Text -> Interface -> InputConfiguration)
-> Parser Text -> Parser (Interface -> InputConfiguration)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"inputIp")
Parser (Interface -> InputConfiguration)
-> Parser Interface -> Parser InputConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser Interface
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"interface")
)
instance Prelude.Hashable InputConfiguration
instance Prelude.NFData InputConfiguration