{-# 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.MediaStreamSourceConfigurationRequest
-- 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.MediaStreamSourceConfigurationRequest where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.EncodingName
import Amazonka.MediaConnect.Types.InputConfigurationRequest
import qualified Amazonka.Prelude as Prelude

-- | The definition of a media stream that you want to associate with the
-- source.
--
-- /See:/ 'newMediaStreamSourceConfigurationRequest' smart constructor.
data MediaStreamSourceConfigurationRequest = MediaStreamSourceConfigurationRequest'
  { -- | The transport parameters that you want to associate with the media
    -- stream.
    MediaStreamSourceConfigurationRequest
-> Maybe [InputConfigurationRequest]
inputConfigurations :: Prelude.Maybe [InputConfigurationRequest],
    -- | The name of the media stream.
    MediaStreamSourceConfigurationRequest -> Text
mediaStreamName :: Prelude.Text,
    -- | The format you want to use to encode the data. For ancillary data
    -- streams, set the encoding name to smpte291. For audio streams, set the
    -- encoding name to pcm. For video, 2110 streams, set the encoding name to
    -- raw. For video, JPEG XS streams, set the encoding name to jxsv.
    MediaStreamSourceConfigurationRequest -> EncodingName
encodingName :: EncodingName
  }
  deriving (MediaStreamSourceConfigurationRequest
-> MediaStreamSourceConfigurationRequest -> Bool
(MediaStreamSourceConfigurationRequest
 -> MediaStreamSourceConfigurationRequest -> Bool)
-> (MediaStreamSourceConfigurationRequest
    -> MediaStreamSourceConfigurationRequest -> Bool)
-> Eq MediaStreamSourceConfigurationRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MediaStreamSourceConfigurationRequest
-> MediaStreamSourceConfigurationRequest -> Bool
$c/= :: MediaStreamSourceConfigurationRequest
-> MediaStreamSourceConfigurationRequest -> Bool
== :: MediaStreamSourceConfigurationRequest
-> MediaStreamSourceConfigurationRequest -> Bool
$c== :: MediaStreamSourceConfigurationRequest
-> MediaStreamSourceConfigurationRequest -> Bool
Prelude.Eq, ReadPrec [MediaStreamSourceConfigurationRequest]
ReadPrec MediaStreamSourceConfigurationRequest
Int -> ReadS MediaStreamSourceConfigurationRequest
ReadS [MediaStreamSourceConfigurationRequest]
(Int -> ReadS MediaStreamSourceConfigurationRequest)
-> ReadS [MediaStreamSourceConfigurationRequest]
-> ReadPrec MediaStreamSourceConfigurationRequest
-> ReadPrec [MediaStreamSourceConfigurationRequest]
-> Read MediaStreamSourceConfigurationRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MediaStreamSourceConfigurationRequest]
$creadListPrec :: ReadPrec [MediaStreamSourceConfigurationRequest]
readPrec :: ReadPrec MediaStreamSourceConfigurationRequest
$creadPrec :: ReadPrec MediaStreamSourceConfigurationRequest
readList :: ReadS [MediaStreamSourceConfigurationRequest]
$creadList :: ReadS [MediaStreamSourceConfigurationRequest]
readsPrec :: Int -> ReadS MediaStreamSourceConfigurationRequest
$creadsPrec :: Int -> ReadS MediaStreamSourceConfigurationRequest
Prelude.Read, Int -> MediaStreamSourceConfigurationRequest -> ShowS
[MediaStreamSourceConfigurationRequest] -> ShowS
MediaStreamSourceConfigurationRequest -> String
(Int -> MediaStreamSourceConfigurationRequest -> ShowS)
-> (MediaStreamSourceConfigurationRequest -> String)
-> ([MediaStreamSourceConfigurationRequest] -> ShowS)
-> Show MediaStreamSourceConfigurationRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MediaStreamSourceConfigurationRequest] -> ShowS
$cshowList :: [MediaStreamSourceConfigurationRequest] -> ShowS
show :: MediaStreamSourceConfigurationRequest -> String
$cshow :: MediaStreamSourceConfigurationRequest -> String
showsPrec :: Int -> MediaStreamSourceConfigurationRequest -> ShowS
$cshowsPrec :: Int -> MediaStreamSourceConfigurationRequest -> ShowS
Prelude.Show, (forall x.
 MediaStreamSourceConfigurationRequest
 -> Rep MediaStreamSourceConfigurationRequest x)
-> (forall x.
    Rep MediaStreamSourceConfigurationRequest x
    -> MediaStreamSourceConfigurationRequest)
-> Generic MediaStreamSourceConfigurationRequest
forall x.
Rep MediaStreamSourceConfigurationRequest x
-> MediaStreamSourceConfigurationRequest
forall x.
MediaStreamSourceConfigurationRequest
-> Rep MediaStreamSourceConfigurationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MediaStreamSourceConfigurationRequest x
-> MediaStreamSourceConfigurationRequest
$cfrom :: forall x.
MediaStreamSourceConfigurationRequest
-> Rep MediaStreamSourceConfigurationRequest x
Prelude.Generic)

-- |
-- Create a value of 'MediaStreamSourceConfigurationRequest' 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:
--
-- 'inputConfigurations', 'mediaStreamSourceConfigurationRequest_inputConfigurations' - The transport parameters that you want to associate with the media
-- stream.
--
-- 'mediaStreamName', 'mediaStreamSourceConfigurationRequest_mediaStreamName' - The name of the media stream.
--
-- 'encodingName', 'mediaStreamSourceConfigurationRequest_encodingName' - The format you want to use to encode the data. For ancillary data
-- streams, set the encoding name to smpte291. For audio streams, set the
-- encoding name to pcm. For video, 2110 streams, set the encoding name to
-- raw. For video, JPEG XS streams, set the encoding name to jxsv.
newMediaStreamSourceConfigurationRequest ::
  -- | 'mediaStreamName'
  Prelude.Text ->
  -- | 'encodingName'
  EncodingName ->
  MediaStreamSourceConfigurationRequest
newMediaStreamSourceConfigurationRequest :: Text -> EncodingName -> MediaStreamSourceConfigurationRequest
newMediaStreamSourceConfigurationRequest
  Text
pMediaStreamName_
  EncodingName
pEncodingName_ =
    MediaStreamSourceConfigurationRequest' :: Maybe [InputConfigurationRequest]
-> Text -> EncodingName -> MediaStreamSourceConfigurationRequest
MediaStreamSourceConfigurationRequest'
      { $sel:inputConfigurations:MediaStreamSourceConfigurationRequest' :: Maybe [InputConfigurationRequest]
inputConfigurations =
          Maybe [InputConfigurationRequest]
forall a. Maybe a
Prelude.Nothing,
        $sel:mediaStreamName:MediaStreamSourceConfigurationRequest' :: Text
mediaStreamName = Text
pMediaStreamName_,
        $sel:encodingName:MediaStreamSourceConfigurationRequest' :: EncodingName
encodingName = EncodingName
pEncodingName_
      }

-- | The transport parameters that you want to associate with the media
-- stream.
mediaStreamSourceConfigurationRequest_inputConfigurations :: Lens.Lens' MediaStreamSourceConfigurationRequest (Prelude.Maybe [InputConfigurationRequest])
mediaStreamSourceConfigurationRequest_inputConfigurations :: (Maybe [InputConfigurationRequest]
 -> f (Maybe [InputConfigurationRequest]))
-> MediaStreamSourceConfigurationRequest
-> f MediaStreamSourceConfigurationRequest
mediaStreamSourceConfigurationRequest_inputConfigurations = (MediaStreamSourceConfigurationRequest
 -> Maybe [InputConfigurationRequest])
-> (MediaStreamSourceConfigurationRequest
    -> Maybe [InputConfigurationRequest]
    -> MediaStreamSourceConfigurationRequest)
-> Lens
     MediaStreamSourceConfigurationRequest
     MediaStreamSourceConfigurationRequest
     (Maybe [InputConfigurationRequest])
     (Maybe [InputConfigurationRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStreamSourceConfigurationRequest' {Maybe [InputConfigurationRequest]
inputConfigurations :: Maybe [InputConfigurationRequest]
$sel:inputConfigurations:MediaStreamSourceConfigurationRequest' :: MediaStreamSourceConfigurationRequest
-> Maybe [InputConfigurationRequest]
inputConfigurations} -> Maybe [InputConfigurationRequest]
inputConfigurations) (\s :: MediaStreamSourceConfigurationRequest
s@MediaStreamSourceConfigurationRequest' {} Maybe [InputConfigurationRequest]
a -> MediaStreamSourceConfigurationRequest
s {$sel:inputConfigurations:MediaStreamSourceConfigurationRequest' :: Maybe [InputConfigurationRequest]
inputConfigurations = Maybe [InputConfigurationRequest]
a} :: MediaStreamSourceConfigurationRequest) ((Maybe [InputConfigurationRequest]
  -> f (Maybe [InputConfigurationRequest]))
 -> MediaStreamSourceConfigurationRequest
 -> f MediaStreamSourceConfigurationRequest)
-> ((Maybe [InputConfigurationRequest]
     -> f (Maybe [InputConfigurationRequest]))
    -> Maybe [InputConfigurationRequest]
    -> f (Maybe [InputConfigurationRequest]))
-> (Maybe [InputConfigurationRequest]
    -> f (Maybe [InputConfigurationRequest]))
-> MediaStreamSourceConfigurationRequest
-> f MediaStreamSourceConfigurationRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [InputConfigurationRequest]
  [InputConfigurationRequest]
  [InputConfigurationRequest]
  [InputConfigurationRequest]
-> Iso
     (Maybe [InputConfigurationRequest])
     (Maybe [InputConfigurationRequest])
     (Maybe [InputConfigurationRequest])
     (Maybe [InputConfigurationRequest])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso
  [InputConfigurationRequest]
  [InputConfigurationRequest]
  [InputConfigurationRequest]
  [InputConfigurationRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | The name of the media stream.
mediaStreamSourceConfigurationRequest_mediaStreamName :: Lens.Lens' MediaStreamSourceConfigurationRequest Prelude.Text
mediaStreamSourceConfigurationRequest_mediaStreamName :: (Text -> f Text)
-> MediaStreamSourceConfigurationRequest
-> f MediaStreamSourceConfigurationRequest
mediaStreamSourceConfigurationRequest_mediaStreamName = (MediaStreamSourceConfigurationRequest -> Text)
-> (MediaStreamSourceConfigurationRequest
    -> Text -> MediaStreamSourceConfigurationRequest)
-> Lens
     MediaStreamSourceConfigurationRequest
     MediaStreamSourceConfigurationRequest
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStreamSourceConfigurationRequest' {Text
mediaStreamName :: Text
$sel:mediaStreamName:MediaStreamSourceConfigurationRequest' :: MediaStreamSourceConfigurationRequest -> Text
mediaStreamName} -> Text
mediaStreamName) (\s :: MediaStreamSourceConfigurationRequest
s@MediaStreamSourceConfigurationRequest' {} Text
a -> MediaStreamSourceConfigurationRequest
s {$sel:mediaStreamName:MediaStreamSourceConfigurationRequest' :: Text
mediaStreamName = Text
a} :: MediaStreamSourceConfigurationRequest)

-- | The format you want to use to encode the data. For ancillary data
-- streams, set the encoding name to smpte291. For audio streams, set the
-- encoding name to pcm. For video, 2110 streams, set the encoding name to
-- raw. For video, JPEG XS streams, set the encoding name to jxsv.
mediaStreamSourceConfigurationRequest_encodingName :: Lens.Lens' MediaStreamSourceConfigurationRequest EncodingName
mediaStreamSourceConfigurationRequest_encodingName :: (EncodingName -> f EncodingName)
-> MediaStreamSourceConfigurationRequest
-> f MediaStreamSourceConfigurationRequest
mediaStreamSourceConfigurationRequest_encodingName = (MediaStreamSourceConfigurationRequest -> EncodingName)
-> (MediaStreamSourceConfigurationRequest
    -> EncodingName -> MediaStreamSourceConfigurationRequest)
-> Lens
     MediaStreamSourceConfigurationRequest
     MediaStreamSourceConfigurationRequest
     EncodingName
     EncodingName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStreamSourceConfigurationRequest' {EncodingName
encodingName :: EncodingName
$sel:encodingName:MediaStreamSourceConfigurationRequest' :: MediaStreamSourceConfigurationRequest -> EncodingName
encodingName} -> EncodingName
encodingName) (\s :: MediaStreamSourceConfigurationRequest
s@MediaStreamSourceConfigurationRequest' {} EncodingName
a -> MediaStreamSourceConfigurationRequest
s {$sel:encodingName:MediaStreamSourceConfigurationRequest' :: EncodingName
encodingName = EncodingName
a} :: MediaStreamSourceConfigurationRequest)

instance
  Prelude.Hashable
    MediaStreamSourceConfigurationRequest

instance
  Prelude.NFData
    MediaStreamSourceConfigurationRequest

instance
  Core.ToJSON
    MediaStreamSourceConfigurationRequest
  where
  toJSON :: MediaStreamSourceConfigurationRequest -> Value
toJSON MediaStreamSourceConfigurationRequest' {Maybe [InputConfigurationRequest]
Text
EncodingName
encodingName :: EncodingName
mediaStreamName :: Text
inputConfigurations :: Maybe [InputConfigurationRequest]
$sel:encodingName:MediaStreamSourceConfigurationRequest' :: MediaStreamSourceConfigurationRequest -> EncodingName
$sel:mediaStreamName:MediaStreamSourceConfigurationRequest' :: MediaStreamSourceConfigurationRequest -> Text
$sel:inputConfigurations:MediaStreamSourceConfigurationRequest' :: MediaStreamSourceConfigurationRequest
-> Maybe [InputConfigurationRequest]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"inputConfigurations" Text -> [InputConfigurationRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([InputConfigurationRequest] -> Pair)
-> Maybe [InputConfigurationRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [InputConfigurationRequest]
inputConfigurations,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              (Text
"mediaStreamName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
mediaStreamName),
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"encodingName" Text -> EncodingName -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= EncodingName
encodingName)
          ]
      )