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

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

-- | MediaPackage Output Destination Settings
--
-- /See:/ 'newMediaPackageOutputDestinationSettings' smart constructor.
data MediaPackageOutputDestinationSettings = MediaPackageOutputDestinationSettings'
  { -- | ID of the channel in MediaPackage that is the destination for this
    -- output group. You do not need to specify the individual inputs in
    -- MediaPackage; MediaLive will handle the connection of the two MediaLive
    -- pipelines to the two MediaPackage inputs. The MediaPackage channel and
    -- MediaLive channel must be in the same region.
    MediaPackageOutputDestinationSettings -> Maybe Text
channelId :: Prelude.Maybe Prelude.Text
  }
  deriving (MediaPackageOutputDestinationSettings
-> MediaPackageOutputDestinationSettings -> Bool
(MediaPackageOutputDestinationSettings
 -> MediaPackageOutputDestinationSettings -> Bool)
-> (MediaPackageOutputDestinationSettings
    -> MediaPackageOutputDestinationSettings -> Bool)
-> Eq MediaPackageOutputDestinationSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MediaPackageOutputDestinationSettings
-> MediaPackageOutputDestinationSettings -> Bool
$c/= :: MediaPackageOutputDestinationSettings
-> MediaPackageOutputDestinationSettings -> Bool
== :: MediaPackageOutputDestinationSettings
-> MediaPackageOutputDestinationSettings -> Bool
$c== :: MediaPackageOutputDestinationSettings
-> MediaPackageOutputDestinationSettings -> Bool
Prelude.Eq, ReadPrec [MediaPackageOutputDestinationSettings]
ReadPrec MediaPackageOutputDestinationSettings
Int -> ReadS MediaPackageOutputDestinationSettings
ReadS [MediaPackageOutputDestinationSettings]
(Int -> ReadS MediaPackageOutputDestinationSettings)
-> ReadS [MediaPackageOutputDestinationSettings]
-> ReadPrec MediaPackageOutputDestinationSettings
-> ReadPrec [MediaPackageOutputDestinationSettings]
-> Read MediaPackageOutputDestinationSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MediaPackageOutputDestinationSettings]
$creadListPrec :: ReadPrec [MediaPackageOutputDestinationSettings]
readPrec :: ReadPrec MediaPackageOutputDestinationSettings
$creadPrec :: ReadPrec MediaPackageOutputDestinationSettings
readList :: ReadS [MediaPackageOutputDestinationSettings]
$creadList :: ReadS [MediaPackageOutputDestinationSettings]
readsPrec :: Int -> ReadS MediaPackageOutputDestinationSettings
$creadsPrec :: Int -> ReadS MediaPackageOutputDestinationSettings
Prelude.Read, Int -> MediaPackageOutputDestinationSettings -> ShowS
[MediaPackageOutputDestinationSettings] -> ShowS
MediaPackageOutputDestinationSettings -> String
(Int -> MediaPackageOutputDestinationSettings -> ShowS)
-> (MediaPackageOutputDestinationSettings -> String)
-> ([MediaPackageOutputDestinationSettings] -> ShowS)
-> Show MediaPackageOutputDestinationSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MediaPackageOutputDestinationSettings] -> ShowS
$cshowList :: [MediaPackageOutputDestinationSettings] -> ShowS
show :: MediaPackageOutputDestinationSettings -> String
$cshow :: MediaPackageOutputDestinationSettings -> String
showsPrec :: Int -> MediaPackageOutputDestinationSettings -> ShowS
$cshowsPrec :: Int -> MediaPackageOutputDestinationSettings -> ShowS
Prelude.Show, (forall x.
 MediaPackageOutputDestinationSettings
 -> Rep MediaPackageOutputDestinationSettings x)
-> (forall x.
    Rep MediaPackageOutputDestinationSettings x
    -> MediaPackageOutputDestinationSettings)
-> Generic MediaPackageOutputDestinationSettings
forall x.
Rep MediaPackageOutputDestinationSettings x
-> MediaPackageOutputDestinationSettings
forall x.
MediaPackageOutputDestinationSettings
-> Rep MediaPackageOutputDestinationSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MediaPackageOutputDestinationSettings x
-> MediaPackageOutputDestinationSettings
$cfrom :: forall x.
MediaPackageOutputDestinationSettings
-> Rep MediaPackageOutputDestinationSettings x
Prelude.Generic)

-- |
-- Create a value of 'MediaPackageOutputDestinationSettings' 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:
--
-- 'channelId', 'mediaPackageOutputDestinationSettings_channelId' - ID of the channel in MediaPackage that is the destination for this
-- output group. You do not need to specify the individual inputs in
-- MediaPackage; MediaLive will handle the connection of the two MediaLive
-- pipelines to the two MediaPackage inputs. The MediaPackage channel and
-- MediaLive channel must be in the same region.
newMediaPackageOutputDestinationSettings ::
  MediaPackageOutputDestinationSettings
newMediaPackageOutputDestinationSettings :: MediaPackageOutputDestinationSettings
newMediaPackageOutputDestinationSettings =
  MediaPackageOutputDestinationSettings' :: Maybe Text -> MediaPackageOutputDestinationSettings
MediaPackageOutputDestinationSettings'
    { $sel:channelId:MediaPackageOutputDestinationSettings' :: Maybe Text
channelId =
        Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | ID of the channel in MediaPackage that is the destination for this
-- output group. You do not need to specify the individual inputs in
-- MediaPackage; MediaLive will handle the connection of the two MediaLive
-- pipelines to the two MediaPackage inputs. The MediaPackage channel and
-- MediaLive channel must be in the same region.
mediaPackageOutputDestinationSettings_channelId :: Lens.Lens' MediaPackageOutputDestinationSettings (Prelude.Maybe Prelude.Text)
mediaPackageOutputDestinationSettings_channelId :: (Maybe Text -> f (Maybe Text))
-> MediaPackageOutputDestinationSettings
-> f MediaPackageOutputDestinationSettings
mediaPackageOutputDestinationSettings_channelId = (MediaPackageOutputDestinationSettings -> Maybe Text)
-> (MediaPackageOutputDestinationSettings
    -> Maybe Text -> MediaPackageOutputDestinationSettings)
-> Lens
     MediaPackageOutputDestinationSettings
     MediaPackageOutputDestinationSettings
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MediaPackageOutputDestinationSettings' {Maybe Text
channelId :: Maybe Text
$sel:channelId:MediaPackageOutputDestinationSettings' :: MediaPackageOutputDestinationSettings -> Maybe Text
channelId} -> Maybe Text
channelId) (\s :: MediaPackageOutputDestinationSettings
s@MediaPackageOutputDestinationSettings' {} Maybe Text
a -> MediaPackageOutputDestinationSettings
s {$sel:channelId:MediaPackageOutputDestinationSettings' :: Maybe Text
channelId = Maybe Text
a} :: MediaPackageOutputDestinationSettings)

instance
  Core.FromJSON
    MediaPackageOutputDestinationSettings
  where
  parseJSON :: Value -> Parser MediaPackageOutputDestinationSettings
parseJSON =
    String
-> (Object -> Parser MediaPackageOutputDestinationSettings)
-> Value
-> Parser MediaPackageOutputDestinationSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MediaPackageOutputDestinationSettings"
      ( \Object
x ->
          Maybe Text -> MediaPackageOutputDestinationSettings
MediaPackageOutputDestinationSettings'
            (Maybe Text -> MediaPackageOutputDestinationSettings)
-> Parser (Maybe Text)
-> Parser MediaPackageOutputDestinationSettings
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
"channelId")
      )

instance
  Prelude.Hashable
    MediaPackageOutputDestinationSettings

instance
  Prelude.NFData
    MediaPackageOutputDestinationSettings

instance
  Core.ToJSON
    MediaPackageOutputDestinationSettings
  where
  toJSON :: MediaPackageOutputDestinationSettings -> Value
toJSON MediaPackageOutputDestinationSettings' {Maybe Text
channelId :: Maybe Text
$sel:channelId:MediaPackageOutputDestinationSettings' :: MediaPackageOutputDestinationSettings -> Maybe Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [(Text
"channelId" 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
channelId]
      )