{-# 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.MediaLive.Types.MultiplexProgramChannelDestinationSettings
-- 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.MediaLive.Types.MultiplexProgramChannelDestinationSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import qualified Amazonka.Prelude as Prelude

-- | Multiplex Program Input Destination Settings for outputting a Channel to
-- a Multiplex
--
-- /See:/ 'newMultiplexProgramChannelDestinationSettings' smart constructor.
data MultiplexProgramChannelDestinationSettings = MultiplexProgramChannelDestinationSettings'
  { -- | The ID of the Multiplex that the encoder is providing output to. You do
    -- not need to specify the individual inputs to the Multiplex; MediaLive
    -- will handle the connection of the two MediaLive pipelines to the two
    -- Multiplex instances. The Multiplex must be in the same region as the
    -- Channel.
    MultiplexProgramChannelDestinationSettings -> Maybe Text
multiplexId :: Prelude.Maybe Prelude.Text,
    -- | The program name of the Multiplex program that the encoder is providing
    -- output to.
    MultiplexProgramChannelDestinationSettings -> Maybe Text
programName :: Prelude.Maybe Prelude.Text
  }
  deriving (MultiplexProgramChannelDestinationSettings
-> MultiplexProgramChannelDestinationSettings -> Bool
(MultiplexProgramChannelDestinationSettings
 -> MultiplexProgramChannelDestinationSettings -> Bool)
-> (MultiplexProgramChannelDestinationSettings
    -> MultiplexProgramChannelDestinationSettings -> Bool)
-> Eq MultiplexProgramChannelDestinationSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MultiplexProgramChannelDestinationSettings
-> MultiplexProgramChannelDestinationSettings -> Bool
$c/= :: MultiplexProgramChannelDestinationSettings
-> MultiplexProgramChannelDestinationSettings -> Bool
== :: MultiplexProgramChannelDestinationSettings
-> MultiplexProgramChannelDestinationSettings -> Bool
$c== :: MultiplexProgramChannelDestinationSettings
-> MultiplexProgramChannelDestinationSettings -> Bool
Prelude.Eq, ReadPrec [MultiplexProgramChannelDestinationSettings]
ReadPrec MultiplexProgramChannelDestinationSettings
Int -> ReadS MultiplexProgramChannelDestinationSettings
ReadS [MultiplexProgramChannelDestinationSettings]
(Int -> ReadS MultiplexProgramChannelDestinationSettings)
-> ReadS [MultiplexProgramChannelDestinationSettings]
-> ReadPrec MultiplexProgramChannelDestinationSettings
-> ReadPrec [MultiplexProgramChannelDestinationSettings]
-> Read MultiplexProgramChannelDestinationSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MultiplexProgramChannelDestinationSettings]
$creadListPrec :: ReadPrec [MultiplexProgramChannelDestinationSettings]
readPrec :: ReadPrec MultiplexProgramChannelDestinationSettings
$creadPrec :: ReadPrec MultiplexProgramChannelDestinationSettings
readList :: ReadS [MultiplexProgramChannelDestinationSettings]
$creadList :: ReadS [MultiplexProgramChannelDestinationSettings]
readsPrec :: Int -> ReadS MultiplexProgramChannelDestinationSettings
$creadsPrec :: Int -> ReadS MultiplexProgramChannelDestinationSettings
Prelude.Read, Int -> MultiplexProgramChannelDestinationSettings -> ShowS
[MultiplexProgramChannelDestinationSettings] -> ShowS
MultiplexProgramChannelDestinationSettings -> String
(Int -> MultiplexProgramChannelDestinationSettings -> ShowS)
-> (MultiplexProgramChannelDestinationSettings -> String)
-> ([MultiplexProgramChannelDestinationSettings] -> ShowS)
-> Show MultiplexProgramChannelDestinationSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MultiplexProgramChannelDestinationSettings] -> ShowS
$cshowList :: [MultiplexProgramChannelDestinationSettings] -> ShowS
show :: MultiplexProgramChannelDestinationSettings -> String
$cshow :: MultiplexProgramChannelDestinationSettings -> String
showsPrec :: Int -> MultiplexProgramChannelDestinationSettings -> ShowS
$cshowsPrec :: Int -> MultiplexProgramChannelDestinationSettings -> ShowS
Prelude.Show, (forall x.
 MultiplexProgramChannelDestinationSettings
 -> Rep MultiplexProgramChannelDestinationSettings x)
-> (forall x.
    Rep MultiplexProgramChannelDestinationSettings x
    -> MultiplexProgramChannelDestinationSettings)
-> Generic MultiplexProgramChannelDestinationSettings
forall x.
Rep MultiplexProgramChannelDestinationSettings x
-> MultiplexProgramChannelDestinationSettings
forall x.
MultiplexProgramChannelDestinationSettings
-> Rep MultiplexProgramChannelDestinationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MultiplexProgramChannelDestinationSettings x
-> MultiplexProgramChannelDestinationSettings
$cfrom :: forall x.
MultiplexProgramChannelDestinationSettings
-> Rep MultiplexProgramChannelDestinationSettings x
Prelude.Generic)

-- |
-- Create a value of 'MultiplexProgramChannelDestinationSettings' 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:
--
-- 'multiplexId', 'multiplexProgramChannelDestinationSettings_multiplexId' - The ID of the Multiplex that the encoder is providing output to. You do
-- not need to specify the individual inputs to the Multiplex; MediaLive
-- will handle the connection of the two MediaLive pipelines to the two
-- Multiplex instances. The Multiplex must be in the same region as the
-- Channel.
--
-- 'programName', 'multiplexProgramChannelDestinationSettings_programName' - The program name of the Multiplex program that the encoder is providing
-- output to.
newMultiplexProgramChannelDestinationSettings ::
  MultiplexProgramChannelDestinationSettings
newMultiplexProgramChannelDestinationSettings :: MultiplexProgramChannelDestinationSettings
newMultiplexProgramChannelDestinationSettings =
  MultiplexProgramChannelDestinationSettings' :: Maybe Text
-> Maybe Text -> MultiplexProgramChannelDestinationSettings
MultiplexProgramChannelDestinationSettings'
    { $sel:multiplexId:MultiplexProgramChannelDestinationSettings' :: Maybe Text
multiplexId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:programName:MultiplexProgramChannelDestinationSettings' :: Maybe Text
programName = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | The ID of the Multiplex that the encoder is providing output to. You do
-- not need to specify the individual inputs to the Multiplex; MediaLive
-- will handle the connection of the two MediaLive pipelines to the two
-- Multiplex instances. The Multiplex must be in the same region as the
-- Channel.
multiplexProgramChannelDestinationSettings_multiplexId :: Lens.Lens' MultiplexProgramChannelDestinationSettings (Prelude.Maybe Prelude.Text)
multiplexProgramChannelDestinationSettings_multiplexId :: (Maybe Text -> f (Maybe Text))
-> MultiplexProgramChannelDestinationSettings
-> f MultiplexProgramChannelDestinationSettings
multiplexProgramChannelDestinationSettings_multiplexId = (MultiplexProgramChannelDestinationSettings -> Maybe Text)
-> (MultiplexProgramChannelDestinationSettings
    -> Maybe Text -> MultiplexProgramChannelDestinationSettings)
-> Lens
     MultiplexProgramChannelDestinationSettings
     MultiplexProgramChannelDestinationSettings
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexProgramChannelDestinationSettings' {Maybe Text
multiplexId :: Maybe Text
$sel:multiplexId:MultiplexProgramChannelDestinationSettings' :: MultiplexProgramChannelDestinationSettings -> Maybe Text
multiplexId} -> Maybe Text
multiplexId) (\s :: MultiplexProgramChannelDestinationSettings
s@MultiplexProgramChannelDestinationSettings' {} Maybe Text
a -> MultiplexProgramChannelDestinationSettings
s {$sel:multiplexId:MultiplexProgramChannelDestinationSettings' :: Maybe Text
multiplexId = Maybe Text
a} :: MultiplexProgramChannelDestinationSettings)

-- | The program name of the Multiplex program that the encoder is providing
-- output to.
multiplexProgramChannelDestinationSettings_programName :: Lens.Lens' MultiplexProgramChannelDestinationSettings (Prelude.Maybe Prelude.Text)
multiplexProgramChannelDestinationSettings_programName :: (Maybe Text -> f (Maybe Text))
-> MultiplexProgramChannelDestinationSettings
-> f MultiplexProgramChannelDestinationSettings
multiplexProgramChannelDestinationSettings_programName = (MultiplexProgramChannelDestinationSettings -> Maybe Text)
-> (MultiplexProgramChannelDestinationSettings
    -> Maybe Text -> MultiplexProgramChannelDestinationSettings)
-> Lens
     MultiplexProgramChannelDestinationSettings
     MultiplexProgramChannelDestinationSettings
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexProgramChannelDestinationSettings' {Maybe Text
programName :: Maybe Text
$sel:programName:MultiplexProgramChannelDestinationSettings' :: MultiplexProgramChannelDestinationSettings -> Maybe Text
programName} -> Maybe Text
programName) (\s :: MultiplexProgramChannelDestinationSettings
s@MultiplexProgramChannelDestinationSettings' {} Maybe Text
a -> MultiplexProgramChannelDestinationSettings
s {$sel:programName:MultiplexProgramChannelDestinationSettings' :: Maybe Text
programName = Maybe Text
a} :: MultiplexProgramChannelDestinationSettings)

instance
  Core.FromJSON
    MultiplexProgramChannelDestinationSettings
  where
  parseJSON :: Value -> Parser MultiplexProgramChannelDestinationSettings
parseJSON =
    String
-> (Object -> Parser MultiplexProgramChannelDestinationSettings)
-> Value
-> Parser MultiplexProgramChannelDestinationSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MultiplexProgramChannelDestinationSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> MultiplexProgramChannelDestinationSettings
MultiplexProgramChannelDestinationSettings'
            (Maybe Text
 -> Maybe Text -> MultiplexProgramChannelDestinationSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text -> MultiplexProgramChannelDestinationSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"multiplexId")
              Parser (Maybe Text -> MultiplexProgramChannelDestinationSettings)
-> Parser (Maybe Text)
-> Parser MultiplexProgramChannelDestinationSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"programName")
      )

instance
  Prelude.Hashable
    MultiplexProgramChannelDestinationSettings

instance
  Prelude.NFData
    MultiplexProgramChannelDestinationSettings

instance
  Core.ToJSON
    MultiplexProgramChannelDestinationSettings
  where
  toJSON :: MultiplexProgramChannelDestinationSettings -> Value
toJSON
    MultiplexProgramChannelDestinationSettings' {Maybe Text
programName :: Maybe Text
multiplexId :: Maybe Text
$sel:programName:MultiplexProgramChannelDestinationSettings' :: MultiplexProgramChannelDestinationSettings -> Maybe Text
$sel:multiplexId:MultiplexProgramChannelDestinationSettings' :: MultiplexProgramChannelDestinationSettings -> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"multiplexId" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
multiplexId,
              (Text
"programName" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
programName
            ]
        )