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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.MultiplexMediaConnectOutputDestinationSettings
import qualified Amazonka.Prelude as Prelude

-- | Multiplex output destination settings
--
-- /See:/ 'newMultiplexOutputDestination' smart constructor.
data MultiplexOutputDestination = MultiplexOutputDestination'
  { -- | Multiplex MediaConnect output destination settings.
    MultiplexOutputDestination
-> Maybe MultiplexMediaConnectOutputDestinationSettings
mediaConnectSettings :: Prelude.Maybe MultiplexMediaConnectOutputDestinationSettings
  }
  deriving (MultiplexOutputDestination -> MultiplexOutputDestination -> Bool
(MultiplexOutputDestination -> MultiplexOutputDestination -> Bool)
-> (MultiplexOutputDestination
    -> MultiplexOutputDestination -> Bool)
-> Eq MultiplexOutputDestination
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MultiplexOutputDestination -> MultiplexOutputDestination -> Bool
$c/= :: MultiplexOutputDestination -> MultiplexOutputDestination -> Bool
== :: MultiplexOutputDestination -> MultiplexOutputDestination -> Bool
$c== :: MultiplexOutputDestination -> MultiplexOutputDestination -> Bool
Prelude.Eq, ReadPrec [MultiplexOutputDestination]
ReadPrec MultiplexOutputDestination
Int -> ReadS MultiplexOutputDestination
ReadS [MultiplexOutputDestination]
(Int -> ReadS MultiplexOutputDestination)
-> ReadS [MultiplexOutputDestination]
-> ReadPrec MultiplexOutputDestination
-> ReadPrec [MultiplexOutputDestination]
-> Read MultiplexOutputDestination
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MultiplexOutputDestination]
$creadListPrec :: ReadPrec [MultiplexOutputDestination]
readPrec :: ReadPrec MultiplexOutputDestination
$creadPrec :: ReadPrec MultiplexOutputDestination
readList :: ReadS [MultiplexOutputDestination]
$creadList :: ReadS [MultiplexOutputDestination]
readsPrec :: Int -> ReadS MultiplexOutputDestination
$creadsPrec :: Int -> ReadS MultiplexOutputDestination
Prelude.Read, Int -> MultiplexOutputDestination -> ShowS
[MultiplexOutputDestination] -> ShowS
MultiplexOutputDestination -> String
(Int -> MultiplexOutputDestination -> ShowS)
-> (MultiplexOutputDestination -> String)
-> ([MultiplexOutputDestination] -> ShowS)
-> Show MultiplexOutputDestination
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MultiplexOutputDestination] -> ShowS
$cshowList :: [MultiplexOutputDestination] -> ShowS
show :: MultiplexOutputDestination -> String
$cshow :: MultiplexOutputDestination -> String
showsPrec :: Int -> MultiplexOutputDestination -> ShowS
$cshowsPrec :: Int -> MultiplexOutputDestination -> ShowS
Prelude.Show, (forall x.
 MultiplexOutputDestination -> Rep MultiplexOutputDestination x)
-> (forall x.
    Rep MultiplexOutputDestination x -> MultiplexOutputDestination)
-> Generic MultiplexOutputDestination
forall x.
Rep MultiplexOutputDestination x -> MultiplexOutputDestination
forall x.
MultiplexOutputDestination -> Rep MultiplexOutputDestination x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MultiplexOutputDestination x -> MultiplexOutputDestination
$cfrom :: forall x.
MultiplexOutputDestination -> Rep MultiplexOutputDestination x
Prelude.Generic)

-- |
-- Create a value of 'MultiplexOutputDestination' 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:
--
-- 'mediaConnectSettings', 'multiplexOutputDestination_mediaConnectSettings' - Multiplex MediaConnect output destination settings.
newMultiplexOutputDestination ::
  MultiplexOutputDestination
newMultiplexOutputDestination :: MultiplexOutputDestination
newMultiplexOutputDestination =
  MultiplexOutputDestination' :: Maybe MultiplexMediaConnectOutputDestinationSettings
-> MultiplexOutputDestination
MultiplexOutputDestination'
    { $sel:mediaConnectSettings:MultiplexOutputDestination' :: Maybe MultiplexMediaConnectOutputDestinationSettings
mediaConnectSettings =
        Maybe MultiplexMediaConnectOutputDestinationSettings
forall a. Maybe a
Prelude.Nothing
    }

-- | Multiplex MediaConnect output destination settings.
multiplexOutputDestination_mediaConnectSettings :: Lens.Lens' MultiplexOutputDestination (Prelude.Maybe MultiplexMediaConnectOutputDestinationSettings)
multiplexOutputDestination_mediaConnectSettings :: (Maybe MultiplexMediaConnectOutputDestinationSettings
 -> f (Maybe MultiplexMediaConnectOutputDestinationSettings))
-> MultiplexOutputDestination -> f MultiplexOutputDestination
multiplexOutputDestination_mediaConnectSettings = (MultiplexOutputDestination
 -> Maybe MultiplexMediaConnectOutputDestinationSettings)
-> (MultiplexOutputDestination
    -> Maybe MultiplexMediaConnectOutputDestinationSettings
    -> MultiplexOutputDestination)
-> Lens
     MultiplexOutputDestination
     MultiplexOutputDestination
     (Maybe MultiplexMediaConnectOutputDestinationSettings)
     (Maybe MultiplexMediaConnectOutputDestinationSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexOutputDestination' {Maybe MultiplexMediaConnectOutputDestinationSettings
mediaConnectSettings :: Maybe MultiplexMediaConnectOutputDestinationSettings
$sel:mediaConnectSettings:MultiplexOutputDestination' :: MultiplexOutputDestination
-> Maybe MultiplexMediaConnectOutputDestinationSettings
mediaConnectSettings} -> Maybe MultiplexMediaConnectOutputDestinationSettings
mediaConnectSettings) (\s :: MultiplexOutputDestination
s@MultiplexOutputDestination' {} Maybe MultiplexMediaConnectOutputDestinationSettings
a -> MultiplexOutputDestination
s {$sel:mediaConnectSettings:MultiplexOutputDestination' :: Maybe MultiplexMediaConnectOutputDestinationSettings
mediaConnectSettings = Maybe MultiplexMediaConnectOutputDestinationSettings
a} :: MultiplexOutputDestination)

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

instance Prelude.Hashable MultiplexOutputDestination

instance Prelude.NFData MultiplexOutputDestination