{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaLive.Types.MultiplexProgramChannelDestinationSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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
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]
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
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.
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'
    { $sel:multiplexId:MultiplexProgramChannelDestinationSettings' :: Maybe Text
multiplexId =
        forall a. Maybe a
Prelude.Nothing,
      $sel:programName:MultiplexProgramChannelDestinationSettings' :: Maybe Text
programName = 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 :: Lens' MultiplexProgramChannelDestinationSettings (Maybe Text)
multiplexProgramChannelDestinationSettings_multiplexId = 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 :: Lens' MultiplexProgramChannelDestinationSettings (Maybe Text)
multiplexProgramChannelDestinationSettings_programName = 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
  Data.FromJSON
    MultiplexProgramChannelDestinationSettings
  where
  parseJSON :: Value -> Parser MultiplexProgramChannelDestinationSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MultiplexProgramChannelDestinationSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe Text -> MultiplexProgramChannelDestinationSettings
MultiplexProgramChannelDestinationSettings'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"multiplexId")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"programName")
      )

instance
  Prelude.Hashable
    MultiplexProgramChannelDestinationSettings
  where
  hashWithSalt :: Int -> MultiplexProgramChannelDestinationSettings -> Int
hashWithSalt
    Int
_salt
    MultiplexProgramChannelDestinationSettings' {Maybe Text
programName :: Maybe Text
multiplexId :: Maybe Text
$sel:programName:MultiplexProgramChannelDestinationSettings' :: MultiplexProgramChannelDestinationSettings -> Maybe Text
$sel:multiplexId:MultiplexProgramChannelDestinationSettings' :: MultiplexProgramChannelDestinationSettings -> Maybe Text
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
multiplexId
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
programName

instance
  Prelude.NFData
    MultiplexProgramChannelDestinationSettings
  where
  rnf :: MultiplexProgramChannelDestinationSettings -> ()
rnf MultiplexProgramChannelDestinationSettings' {Maybe Text
programName :: Maybe Text
multiplexId :: Maybe Text
$sel:programName:MultiplexProgramChannelDestinationSettings' :: MultiplexProgramChannelDestinationSettings -> Maybe Text
$sel:multiplexId:MultiplexProgramChannelDestinationSettings' :: MultiplexProgramChannelDestinationSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
multiplexId
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
programName

instance
  Data.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
Data.object
        ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Key
"multiplexId" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
multiplexId,
              (Key
"programName" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..=) forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
programName
            ]
        )