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

-- | 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
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]
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
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.
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'
    { $sel:channelId:MediaPackageOutputDestinationSettings' :: Maybe Text
channelId =
        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 :: Lens' MediaPackageOutputDestinationSettings (Maybe Text)
mediaPackageOutputDestinationSettings_channelId = 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
  Data.FromJSON
    MediaPackageOutputDestinationSettings
  where
  parseJSON :: Value -> Parser MediaPackageOutputDestinationSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MediaPackageOutputDestinationSettings"
      ( \Object
x ->
          Maybe Text -> MediaPackageOutputDestinationSettings
MediaPackageOutputDestinationSettings'
            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
"channelId")
      )

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

instance
  Prelude.NFData
    MediaPackageOutputDestinationSettings
  where
  rnf :: MediaPackageOutputDestinationSettings -> ()
rnf MediaPackageOutputDestinationSettings' {Maybe Text
channelId :: Maybe Text
$sel:channelId:MediaPackageOutputDestinationSettings' :: MediaPackageOutputDestinationSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
channelId

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