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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.OutputLocationRef
import qualified Amazonka.Prelude as Prelude

-- | Multiplex Output Settings
--
-- /See:/ 'newMultiplexOutputSettings' smart constructor.
data MultiplexOutputSettings = MultiplexOutputSettings'
  { -- | Destination is a Multiplex.
    MultiplexOutputSettings -> OutputLocationRef
destination :: OutputLocationRef
  }
  deriving (MultiplexOutputSettings -> MultiplexOutputSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MultiplexOutputSettings -> MultiplexOutputSettings -> Bool
$c/= :: MultiplexOutputSettings -> MultiplexOutputSettings -> Bool
== :: MultiplexOutputSettings -> MultiplexOutputSettings -> Bool
$c== :: MultiplexOutputSettings -> MultiplexOutputSettings -> Bool
Prelude.Eq, ReadPrec [MultiplexOutputSettings]
ReadPrec MultiplexOutputSettings
Int -> ReadS MultiplexOutputSettings
ReadS [MultiplexOutputSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MultiplexOutputSettings]
$creadListPrec :: ReadPrec [MultiplexOutputSettings]
readPrec :: ReadPrec MultiplexOutputSettings
$creadPrec :: ReadPrec MultiplexOutputSettings
readList :: ReadS [MultiplexOutputSettings]
$creadList :: ReadS [MultiplexOutputSettings]
readsPrec :: Int -> ReadS MultiplexOutputSettings
$creadsPrec :: Int -> ReadS MultiplexOutputSettings
Prelude.Read, Int -> MultiplexOutputSettings -> ShowS
[MultiplexOutputSettings] -> ShowS
MultiplexOutputSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MultiplexOutputSettings] -> ShowS
$cshowList :: [MultiplexOutputSettings] -> ShowS
show :: MultiplexOutputSettings -> String
$cshow :: MultiplexOutputSettings -> String
showsPrec :: Int -> MultiplexOutputSettings -> ShowS
$cshowsPrec :: Int -> MultiplexOutputSettings -> ShowS
Prelude.Show, forall x. Rep MultiplexOutputSettings x -> MultiplexOutputSettings
forall x. MultiplexOutputSettings -> Rep MultiplexOutputSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MultiplexOutputSettings x -> MultiplexOutputSettings
$cfrom :: forall x. MultiplexOutputSettings -> Rep MultiplexOutputSettings x
Prelude.Generic)

-- |
-- Create a value of 'MultiplexOutputSettings' 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:
--
-- 'destination', 'multiplexOutputSettings_destination' - Destination is a Multiplex.
newMultiplexOutputSettings ::
  -- | 'destination'
  OutputLocationRef ->
  MultiplexOutputSettings
newMultiplexOutputSettings :: OutputLocationRef -> MultiplexOutputSettings
newMultiplexOutputSettings OutputLocationRef
pDestination_ =
  MultiplexOutputSettings'
    { $sel:destination:MultiplexOutputSettings' :: OutputLocationRef
destination =
        OutputLocationRef
pDestination_
    }

-- | Destination is a Multiplex.
multiplexOutputSettings_destination :: Lens.Lens' MultiplexOutputSettings OutputLocationRef
multiplexOutputSettings_destination :: Lens' MultiplexOutputSettings OutputLocationRef
multiplexOutputSettings_destination = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MultiplexOutputSettings' {OutputLocationRef
destination :: OutputLocationRef
$sel:destination:MultiplexOutputSettings' :: MultiplexOutputSettings -> OutputLocationRef
destination} -> OutputLocationRef
destination) (\s :: MultiplexOutputSettings
s@MultiplexOutputSettings' {} OutputLocationRef
a -> MultiplexOutputSettings
s {$sel:destination:MultiplexOutputSettings' :: OutputLocationRef
destination = OutputLocationRef
a} :: MultiplexOutputSettings)

instance Data.FromJSON MultiplexOutputSettings where
  parseJSON :: Value -> Parser MultiplexOutputSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MultiplexOutputSettings"
      ( \Object
x ->
          OutputLocationRef -> MultiplexOutputSettings
MultiplexOutputSettings'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"destination")
      )

instance Prelude.Hashable MultiplexOutputSettings where
  hashWithSalt :: Int -> MultiplexOutputSettings -> Int
hashWithSalt Int
_salt MultiplexOutputSettings' {OutputLocationRef
destination :: OutputLocationRef
$sel:destination:MultiplexOutputSettings' :: MultiplexOutputSettings -> OutputLocationRef
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` OutputLocationRef
destination

instance Prelude.NFData MultiplexOutputSettings where
  rnf :: MultiplexOutputSettings -> ()
rnf MultiplexOutputSettings' {OutputLocationRef
destination :: OutputLocationRef
$sel:destination:MultiplexOutputSettings' :: MultiplexOutputSettings -> OutputLocationRef
..} =
    forall a. NFData a => a -> ()
Prelude.rnf OutputLocationRef
destination

instance Data.ToJSON MultiplexOutputSettings where
  toJSON :: MultiplexOutputSettings -> Value
toJSON MultiplexOutputSettings' {OutputLocationRef
destination :: OutputLocationRef
$sel:destination:MultiplexOutputSettings' :: MultiplexOutputSettings -> OutputLocationRef
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [forall a. a -> Maybe a
Prelude.Just (Key
"destination" forall kv v. (KeyValue kv, ToJSON v) => Key -> v -> kv
Data..= OutputLocationRef
destination)]
      )