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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConnect.Types.DestinationConfigurationRequest
import Amazonka.MediaConnect.Types.EncodingName
import Amazonka.MediaConnect.Types.EncodingParametersRequest
import qualified Amazonka.Prelude as Prelude

-- | The media stream that you want to associate with the output, and the
-- parameters for that association.
--
-- /See:/ 'newMediaStreamOutputConfigurationRequest' smart constructor.
data MediaStreamOutputConfigurationRequest = MediaStreamOutputConfigurationRequest'
  { -- | The transport parameters that you want to associate with the media
    -- stream.
    MediaStreamOutputConfigurationRequest
-> Maybe [DestinationConfigurationRequest]
destinationConfigurations :: Prelude.Maybe [DestinationConfigurationRequest],
    -- | A collection of parameters that determine how MediaConnect will convert
    -- the content. These fields only apply to outputs on flows that have a CDI
    -- source.
    MediaStreamOutputConfigurationRequest
-> Maybe EncodingParametersRequest
encodingParameters :: Prelude.Maybe EncodingParametersRequest,
    -- | The name of the media stream that is associated with the output.
    MediaStreamOutputConfigurationRequest -> Text
mediaStreamName :: Prelude.Text,
    -- | The format that will be used 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.
    MediaStreamOutputConfigurationRequest -> EncodingName
encodingName :: EncodingName
  }
  deriving (MediaStreamOutputConfigurationRequest
-> MediaStreamOutputConfigurationRequest -> Bool
(MediaStreamOutputConfigurationRequest
 -> MediaStreamOutputConfigurationRequest -> Bool)
-> (MediaStreamOutputConfigurationRequest
    -> MediaStreamOutputConfigurationRequest -> Bool)
-> Eq MediaStreamOutputConfigurationRequest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MediaStreamOutputConfigurationRequest
-> MediaStreamOutputConfigurationRequest -> Bool
$c/= :: MediaStreamOutputConfigurationRequest
-> MediaStreamOutputConfigurationRequest -> Bool
== :: MediaStreamOutputConfigurationRequest
-> MediaStreamOutputConfigurationRequest -> Bool
$c== :: MediaStreamOutputConfigurationRequest
-> MediaStreamOutputConfigurationRequest -> Bool
Prelude.Eq, ReadPrec [MediaStreamOutputConfigurationRequest]
ReadPrec MediaStreamOutputConfigurationRequest
Int -> ReadS MediaStreamOutputConfigurationRequest
ReadS [MediaStreamOutputConfigurationRequest]
(Int -> ReadS MediaStreamOutputConfigurationRequest)
-> ReadS [MediaStreamOutputConfigurationRequest]
-> ReadPrec MediaStreamOutputConfigurationRequest
-> ReadPrec [MediaStreamOutputConfigurationRequest]
-> Read MediaStreamOutputConfigurationRequest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MediaStreamOutputConfigurationRequest]
$creadListPrec :: ReadPrec [MediaStreamOutputConfigurationRequest]
readPrec :: ReadPrec MediaStreamOutputConfigurationRequest
$creadPrec :: ReadPrec MediaStreamOutputConfigurationRequest
readList :: ReadS [MediaStreamOutputConfigurationRequest]
$creadList :: ReadS [MediaStreamOutputConfigurationRequest]
readsPrec :: Int -> ReadS MediaStreamOutputConfigurationRequest
$creadsPrec :: Int -> ReadS MediaStreamOutputConfigurationRequest
Prelude.Read, Int -> MediaStreamOutputConfigurationRequest -> ShowS
[MediaStreamOutputConfigurationRequest] -> ShowS
MediaStreamOutputConfigurationRequest -> String
(Int -> MediaStreamOutputConfigurationRequest -> ShowS)
-> (MediaStreamOutputConfigurationRequest -> String)
-> ([MediaStreamOutputConfigurationRequest] -> ShowS)
-> Show MediaStreamOutputConfigurationRequest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MediaStreamOutputConfigurationRequest] -> ShowS
$cshowList :: [MediaStreamOutputConfigurationRequest] -> ShowS
show :: MediaStreamOutputConfigurationRequest -> String
$cshow :: MediaStreamOutputConfigurationRequest -> String
showsPrec :: Int -> MediaStreamOutputConfigurationRequest -> ShowS
$cshowsPrec :: Int -> MediaStreamOutputConfigurationRequest -> ShowS
Prelude.Show, (forall x.
 MediaStreamOutputConfigurationRequest
 -> Rep MediaStreamOutputConfigurationRequest x)
-> (forall x.
    Rep MediaStreamOutputConfigurationRequest x
    -> MediaStreamOutputConfigurationRequest)
-> Generic MediaStreamOutputConfigurationRequest
forall x.
Rep MediaStreamOutputConfigurationRequest x
-> MediaStreamOutputConfigurationRequest
forall x.
MediaStreamOutputConfigurationRequest
-> Rep MediaStreamOutputConfigurationRequest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MediaStreamOutputConfigurationRequest x
-> MediaStreamOutputConfigurationRequest
$cfrom :: forall x.
MediaStreamOutputConfigurationRequest
-> Rep MediaStreamOutputConfigurationRequest x
Prelude.Generic)

-- |
-- Create a value of 'MediaStreamOutputConfigurationRequest' 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:
--
-- 'destinationConfigurations', 'mediaStreamOutputConfigurationRequest_destinationConfigurations' - The transport parameters that you want to associate with the media
-- stream.
--
-- 'encodingParameters', 'mediaStreamOutputConfigurationRequest_encodingParameters' - A collection of parameters that determine how MediaConnect will convert
-- the content. These fields only apply to outputs on flows that have a CDI
-- source.
--
-- 'mediaStreamName', 'mediaStreamOutputConfigurationRequest_mediaStreamName' - The name of the media stream that is associated with the output.
--
-- 'encodingName', 'mediaStreamOutputConfigurationRequest_encodingName' - The format that will be used 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.
newMediaStreamOutputConfigurationRequest ::
  -- | 'mediaStreamName'
  Prelude.Text ->
  -- | 'encodingName'
  EncodingName ->
  MediaStreamOutputConfigurationRequest
newMediaStreamOutputConfigurationRequest :: Text -> EncodingName -> MediaStreamOutputConfigurationRequest
newMediaStreamOutputConfigurationRequest
  Text
pMediaStreamName_
  EncodingName
pEncodingName_ =
    MediaStreamOutputConfigurationRequest' :: Maybe [DestinationConfigurationRequest]
-> Maybe EncodingParametersRequest
-> Text
-> EncodingName
-> MediaStreamOutputConfigurationRequest
MediaStreamOutputConfigurationRequest'
      { $sel:destinationConfigurations:MediaStreamOutputConfigurationRequest' :: Maybe [DestinationConfigurationRequest]
destinationConfigurations =
          Maybe [DestinationConfigurationRequest]
forall a. Maybe a
Prelude.Nothing,
        $sel:encodingParameters:MediaStreamOutputConfigurationRequest' :: Maybe EncodingParametersRequest
encodingParameters = Maybe EncodingParametersRequest
forall a. Maybe a
Prelude.Nothing,
        $sel:mediaStreamName:MediaStreamOutputConfigurationRequest' :: Text
mediaStreamName = Text
pMediaStreamName_,
        $sel:encodingName:MediaStreamOutputConfigurationRequest' :: EncodingName
encodingName = EncodingName
pEncodingName_
      }

-- | The transport parameters that you want to associate with the media
-- stream.
mediaStreamOutputConfigurationRequest_destinationConfigurations :: Lens.Lens' MediaStreamOutputConfigurationRequest (Prelude.Maybe [DestinationConfigurationRequest])
mediaStreamOutputConfigurationRequest_destinationConfigurations :: (Maybe [DestinationConfigurationRequest]
 -> f (Maybe [DestinationConfigurationRequest]))
-> MediaStreamOutputConfigurationRequest
-> f MediaStreamOutputConfigurationRequest
mediaStreamOutputConfigurationRequest_destinationConfigurations = (MediaStreamOutputConfigurationRequest
 -> Maybe [DestinationConfigurationRequest])
-> (MediaStreamOutputConfigurationRequest
    -> Maybe [DestinationConfigurationRequest]
    -> MediaStreamOutputConfigurationRequest)
-> Lens
     MediaStreamOutputConfigurationRequest
     MediaStreamOutputConfigurationRequest
     (Maybe [DestinationConfigurationRequest])
     (Maybe [DestinationConfigurationRequest])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStreamOutputConfigurationRequest' {Maybe [DestinationConfigurationRequest]
destinationConfigurations :: Maybe [DestinationConfigurationRequest]
$sel:destinationConfigurations:MediaStreamOutputConfigurationRequest' :: MediaStreamOutputConfigurationRequest
-> Maybe [DestinationConfigurationRequest]
destinationConfigurations} -> Maybe [DestinationConfigurationRequest]
destinationConfigurations) (\s :: MediaStreamOutputConfigurationRequest
s@MediaStreamOutputConfigurationRequest' {} Maybe [DestinationConfigurationRequest]
a -> MediaStreamOutputConfigurationRequest
s {$sel:destinationConfigurations:MediaStreamOutputConfigurationRequest' :: Maybe [DestinationConfigurationRequest]
destinationConfigurations = Maybe [DestinationConfigurationRequest]
a} :: MediaStreamOutputConfigurationRequest) ((Maybe [DestinationConfigurationRequest]
  -> f (Maybe [DestinationConfigurationRequest]))
 -> MediaStreamOutputConfigurationRequest
 -> f MediaStreamOutputConfigurationRequest)
-> ((Maybe [DestinationConfigurationRequest]
     -> f (Maybe [DestinationConfigurationRequest]))
    -> Maybe [DestinationConfigurationRequest]
    -> f (Maybe [DestinationConfigurationRequest]))
-> (Maybe [DestinationConfigurationRequest]
    -> f (Maybe [DestinationConfigurationRequest]))
-> MediaStreamOutputConfigurationRequest
-> f MediaStreamOutputConfigurationRequest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso
  [DestinationConfigurationRequest]
  [DestinationConfigurationRequest]
  [DestinationConfigurationRequest]
  [DestinationConfigurationRequest]
-> Iso
     (Maybe [DestinationConfigurationRequest])
     (Maybe [DestinationConfigurationRequest])
     (Maybe [DestinationConfigurationRequest])
     (Maybe [DestinationConfigurationRequest])
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
  [DestinationConfigurationRequest]
  [DestinationConfigurationRequest]
  [DestinationConfigurationRequest]
  [DestinationConfigurationRequest]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

-- | A collection of parameters that determine how MediaConnect will convert
-- the content. These fields only apply to outputs on flows that have a CDI
-- source.
mediaStreamOutputConfigurationRequest_encodingParameters :: Lens.Lens' MediaStreamOutputConfigurationRequest (Prelude.Maybe EncodingParametersRequest)
mediaStreamOutputConfigurationRequest_encodingParameters :: (Maybe EncodingParametersRequest
 -> f (Maybe EncodingParametersRequest))
-> MediaStreamOutputConfigurationRequest
-> f MediaStreamOutputConfigurationRequest
mediaStreamOutputConfigurationRequest_encodingParameters = (MediaStreamOutputConfigurationRequest
 -> Maybe EncodingParametersRequest)
-> (MediaStreamOutputConfigurationRequest
    -> Maybe EncodingParametersRequest
    -> MediaStreamOutputConfigurationRequest)
-> Lens
     MediaStreamOutputConfigurationRequest
     MediaStreamOutputConfigurationRequest
     (Maybe EncodingParametersRequest)
     (Maybe EncodingParametersRequest)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStreamOutputConfigurationRequest' {Maybe EncodingParametersRequest
encodingParameters :: Maybe EncodingParametersRequest
$sel:encodingParameters:MediaStreamOutputConfigurationRequest' :: MediaStreamOutputConfigurationRequest
-> Maybe EncodingParametersRequest
encodingParameters} -> Maybe EncodingParametersRequest
encodingParameters) (\s :: MediaStreamOutputConfigurationRequest
s@MediaStreamOutputConfigurationRequest' {} Maybe EncodingParametersRequest
a -> MediaStreamOutputConfigurationRequest
s {$sel:encodingParameters:MediaStreamOutputConfigurationRequest' :: Maybe EncodingParametersRequest
encodingParameters = Maybe EncodingParametersRequest
a} :: MediaStreamOutputConfigurationRequest)

-- | The name of the media stream that is associated with the output.
mediaStreamOutputConfigurationRequest_mediaStreamName :: Lens.Lens' MediaStreamOutputConfigurationRequest Prelude.Text
mediaStreamOutputConfigurationRequest_mediaStreamName :: (Text -> f Text)
-> MediaStreamOutputConfigurationRequest
-> f MediaStreamOutputConfigurationRequest
mediaStreamOutputConfigurationRequest_mediaStreamName = (MediaStreamOutputConfigurationRequest -> Text)
-> (MediaStreamOutputConfigurationRequest
    -> Text -> MediaStreamOutputConfigurationRequest)
-> Lens
     MediaStreamOutputConfigurationRequest
     MediaStreamOutputConfigurationRequest
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStreamOutputConfigurationRequest' {Text
mediaStreamName :: Text
$sel:mediaStreamName:MediaStreamOutputConfigurationRequest' :: MediaStreamOutputConfigurationRequest -> Text
mediaStreamName} -> Text
mediaStreamName) (\s :: MediaStreamOutputConfigurationRequest
s@MediaStreamOutputConfigurationRequest' {} Text
a -> MediaStreamOutputConfigurationRequest
s {$sel:mediaStreamName:MediaStreamOutputConfigurationRequest' :: Text
mediaStreamName = Text
a} :: MediaStreamOutputConfigurationRequest)

-- | The format that will be used 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.
mediaStreamOutputConfigurationRequest_encodingName :: Lens.Lens' MediaStreamOutputConfigurationRequest EncodingName
mediaStreamOutputConfigurationRequest_encodingName :: (EncodingName -> f EncodingName)
-> MediaStreamOutputConfigurationRequest
-> f MediaStreamOutputConfigurationRequest
mediaStreamOutputConfigurationRequest_encodingName = (MediaStreamOutputConfigurationRequest -> EncodingName)
-> (MediaStreamOutputConfigurationRequest
    -> EncodingName -> MediaStreamOutputConfigurationRequest)
-> Lens
     MediaStreamOutputConfigurationRequest
     MediaStreamOutputConfigurationRequest
     EncodingName
     EncodingName
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaStreamOutputConfigurationRequest' {EncodingName
encodingName :: EncodingName
$sel:encodingName:MediaStreamOutputConfigurationRequest' :: MediaStreamOutputConfigurationRequest -> EncodingName
encodingName} -> EncodingName
encodingName) (\s :: MediaStreamOutputConfigurationRequest
s@MediaStreamOutputConfigurationRequest' {} EncodingName
a -> MediaStreamOutputConfigurationRequest
s {$sel:encodingName:MediaStreamOutputConfigurationRequest' :: EncodingName
encodingName = EncodingName
a} :: MediaStreamOutputConfigurationRequest)

instance
  Prelude.Hashable
    MediaStreamOutputConfigurationRequest

instance
  Prelude.NFData
    MediaStreamOutputConfigurationRequest

instance
  Core.ToJSON
    MediaStreamOutputConfigurationRequest
  where
  toJSON :: MediaStreamOutputConfigurationRequest -> Value
toJSON MediaStreamOutputConfigurationRequest' {Maybe [DestinationConfigurationRequest]
Maybe EncodingParametersRequest
Text
EncodingName
encodingName :: EncodingName
mediaStreamName :: Text
encodingParameters :: Maybe EncodingParametersRequest
destinationConfigurations :: Maybe [DestinationConfigurationRequest]
$sel:encodingName:MediaStreamOutputConfigurationRequest' :: MediaStreamOutputConfigurationRequest -> EncodingName
$sel:mediaStreamName:MediaStreamOutputConfigurationRequest' :: MediaStreamOutputConfigurationRequest -> Text
$sel:encodingParameters:MediaStreamOutputConfigurationRequest' :: MediaStreamOutputConfigurationRequest
-> Maybe EncodingParametersRequest
$sel:destinationConfigurations:MediaStreamOutputConfigurationRequest' :: MediaStreamOutputConfigurationRequest
-> Maybe [DestinationConfigurationRequest]
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"destinationConfigurations" Text -> [DestinationConfigurationRequest] -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              ([DestinationConfigurationRequest] -> Pair)
-> Maybe [DestinationConfigurationRequest] -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe [DestinationConfigurationRequest]
destinationConfigurations,
            (Text
"encodingParameters" Text -> EncodingParametersRequest -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (EncodingParametersRequest -> Pair)
-> Maybe EncodingParametersRequest -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe EncodingParametersRequest
encodingParameters,
            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)
          ]
      )