{-# 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 #-}

-- Derived from AWS service descriptions, licensed under Apache 2.0.

-- |
-- Module      : Amazonka.MediaConnect.Types.InputConfigurationRequest
-- Copyright   : (c) 2013-2021 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay <brendan.g.hay+amazonka@gmail.com>
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
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

-- | The transport parameters that you want to associate with an incoming
-- media stream.
--
-- /See:/ 'newInputConfigurationRequest' smart constructor.
data InputConfigurationRequest = InputConfigurationRequest'
  { -- | The port that you want the flow to listen on for an incoming media
    -- stream.
    InputConfigurationRequest -> Int
inputPort :: Prelude.Int,
    -- | The VPC interface that you want to use for the incoming media stream.
    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)

-- |
-- Create a value of 'InputConfigurationRequest' with all optional fields omitted.
--
-- Use <https://hackage.haskell.org/package/generic-lens generic-lens> or <https://hackage.haskell.org/package/optics optics> to modify other optional fields.
--
-- The following record fields are available, with the corresponding lenses provided
-- for backwards compatibility:
--
-- 'inputPort', 'inputConfigurationRequest_inputPort' - The port that you want the flow to listen on for an incoming media
-- stream.
--
-- 'interface', 'inputConfigurationRequest_interface' - The VPC interface that you want to use for the incoming media stream.
newInputConfigurationRequest ::
  -- | 'inputPort'
  Prelude.Int ->
  -- | 'interface'
  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_
    }

-- | The port that you want the flow to listen on for an incoming media
-- stream.
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)

-- | The VPC interface that you want to use for the incoming media stream.
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)
          ]
      )