{-# 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.InputConfigurationRequest where
import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.InterfaceRequest
import qualified Amazonka.Prelude as Prelude
data InputConfigurationRequest = InputConfigurationRequest'
{
InputConfigurationRequest -> Int
inputPort :: Prelude.Int,
InputConfigurationRequest -> InterfaceRequest
interface :: InterfaceRequest
}
deriving (InputConfigurationRequest -> InputConfigurationRequest -> Bool
(InputConfigurationRequest -> InputConfigurationRequest -> Bool)
-> (InputConfigurationRequest -> InputConfigurationRequest -> Bool)
-> Eq InputConfigurationRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: InputConfigurationRequest -> InputConfigurationRequest -> Bool
$c/= :: InputConfigurationRequest -> InputConfigurationRequest -> Bool
== :: InputConfigurationRequest -> InputConfigurationRequest -> Bool
$c== :: InputConfigurationRequest -> InputConfigurationRequest -> Bool
Prelude.Eq, ReadPrec [InputConfigurationRequest]
ReadPrec InputConfigurationRequest
Int -> ReadS InputConfigurationRequest
ReadS [InputConfigurationRequest]
(Int -> ReadS InputConfigurationRequest)
-> ReadS [InputConfigurationRequest]
-> ReadPrec InputConfigurationRequest
-> ReadPrec [InputConfigurationRequest]
-> Read InputConfigurationRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [InputConfigurationRequest]
$creadListPrec :: ReadPrec [InputConfigurationRequest]
readPrec :: ReadPrec InputConfigurationRequest
$creadPrec :: ReadPrec InputConfigurationRequest
readList :: ReadS [InputConfigurationRequest]
$creadList :: ReadS [InputConfigurationRequest]
readsPrec :: Int -> ReadS InputConfigurationRequest
$creadsPrec :: Int -> ReadS InputConfigurationRequest
Prelude.Read, Int -> InputConfigurationRequest -> ShowS
[InputConfigurationRequest] -> ShowS
InputConfigurationRequest -> String
(Int -> InputConfigurationRequest -> ShowS)
-> (InputConfigurationRequest -> String)
-> ([InputConfigurationRequest] -> ShowS)
-> Show InputConfigurationRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [InputConfigurationRequest] -> ShowS
$cshowList :: [InputConfigurationRequest] -> ShowS
show :: InputConfigurationRequest -> String
$cshow :: InputConfigurationRequest -> String
showsPrec :: Int -> InputConfigurationRequest -> ShowS
$cshowsPrec :: Int -> InputConfigurationRequest -> ShowS
Prelude.Show, (forall x.
InputConfigurationRequest -> Rep InputConfigurationRequest x)
-> (forall x.
Rep InputConfigurationRequest x -> InputConfigurationRequest)
-> Generic InputConfigurationRequest
forall x.
Rep InputConfigurationRequest x -> InputConfigurationRequest
forall x.
InputConfigurationRequest -> Rep InputConfigurationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep InputConfigurationRequest x -> InputConfigurationRequest
$cfrom :: forall x.
InputConfigurationRequest -> Rep InputConfigurationRequest x
Prelude.Generic)
newInputConfigurationRequest ::
Prelude.Int ->
InterfaceRequest ->
InputConfigurationRequest
newInputConfigurationRequest :: Int -> InterfaceRequest -> InputConfigurationRequest
newInputConfigurationRequest Int
pInputPort_ InterfaceRequest
pInterface_ =
InputConfigurationRequest' :: Int -> InterfaceRequest -> InputConfigurationRequest
InputConfigurationRequest'
{ $sel:inputPort:InputConfigurationRequest' :: Int
inputPort = Int
pInputPort_,
$sel:interface:InputConfigurationRequest' :: InterfaceRequest
interface = InterfaceRequest
pInterface_
}
inputConfigurationRequest_inputPort :: Lens.Lens' InputConfigurationRequest Prelude.Int
inputConfigurationRequest_inputPort :: (Int -> f Int)
-> InputConfigurationRequest -> f InputConfigurationRequest
inputConfigurationRequest_inputPort = (InputConfigurationRequest -> Int)
-> (InputConfigurationRequest -> Int -> InputConfigurationRequest)
-> Lens InputConfigurationRequest InputConfigurationRequest Int Int
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputConfigurationRequest' {Int
inputPort :: Int
$sel:inputPort:InputConfigurationRequest' :: InputConfigurationRequest -> Int
inputPort} -> Int
inputPort) (\s :: InputConfigurationRequest
s@InputConfigurationRequest' {} Int
a -> InputConfigurationRequest
s {$sel:inputPort:InputConfigurationRequest' :: Int
inputPort = Int
a} :: InputConfigurationRequest)
inputConfigurationRequest_interface :: Lens.Lens' InputConfigurationRequest InterfaceRequest
inputConfigurationRequest_interface :: (InterfaceRequest -> f InterfaceRequest)
-> InputConfigurationRequest -> f InputConfigurationRequest
inputConfigurationRequest_interface = (InputConfigurationRequest -> InterfaceRequest)
-> (InputConfigurationRequest
-> InterfaceRequest -> InputConfigurationRequest)
-> Lens
InputConfigurationRequest
InputConfigurationRequest
InterfaceRequest
InterfaceRequest
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\InputConfigurationRequest' {InterfaceRequest
interface :: InterfaceRequest
$sel:interface:InputConfigurationRequest' :: InputConfigurationRequest -> InterfaceRequest
interface} -> InterfaceRequest
interface) (\s :: InputConfigurationRequest
s@InputConfigurationRequest' {} InterfaceRequest
a -> InputConfigurationRequest
s {$sel:interface:InputConfigurationRequest' :: InterfaceRequest
interface = InterfaceRequest
a} :: InputConfigurationRequest)
instance Prelude.Hashable InputConfigurationRequest
instance Prelude.NFData InputConfigurationRequest
instance Core.ToJSON InputConfigurationRequest where
toJSON :: InputConfigurationRequest -> Value
toJSON InputConfigurationRequest' {Int
InterfaceRequest
interface :: InterfaceRequest
inputPort :: Int
$sel:interface:InputConfigurationRequest' :: InputConfigurationRequest -> InterfaceRequest
$sel:inputPort:InputConfigurationRequest' :: InputConfigurationRequest -> Int
..} =
[Pair] -> Value
Core.object
( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
[ Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"inputPort" Text -> Int -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Int
inputPort),
Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"interface" Text -> InterfaceRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= InterfaceRequest
interface)
]
)