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

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

-- | Settings for the action to insert a user-defined ID3 tag in each HLS
-- segment
--
-- /See:/ 'newHlsId3SegmentTaggingScheduleActionSettings' smart constructor.
data HlsId3SegmentTaggingScheduleActionSettings = HlsId3SegmentTaggingScheduleActionSettings'
  { -- | ID3 tag to insert into each segment. Supports special keyword
    -- identifiers to substitute in segment-related values.\\nSupported keyword
    -- identifiers:
    -- https:\/\/docs.aws.amazon.com\/medialive\/latest\/ug\/variable-data-identifiers.html
    HlsId3SegmentTaggingScheduleActionSettings -> Text
tag :: Prelude.Text
  }
  deriving (HlsId3SegmentTaggingScheduleActionSettings
-> HlsId3SegmentTaggingScheduleActionSettings -> Bool
(HlsId3SegmentTaggingScheduleActionSettings
 -> HlsId3SegmentTaggingScheduleActionSettings -> Bool)
-> (HlsId3SegmentTaggingScheduleActionSettings
    -> HlsId3SegmentTaggingScheduleActionSettings -> Bool)
-> Eq HlsId3SegmentTaggingScheduleActionSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HlsId3SegmentTaggingScheduleActionSettings
-> HlsId3SegmentTaggingScheduleActionSettings -> Bool
$c/= :: HlsId3SegmentTaggingScheduleActionSettings
-> HlsId3SegmentTaggingScheduleActionSettings -> Bool
== :: HlsId3SegmentTaggingScheduleActionSettings
-> HlsId3SegmentTaggingScheduleActionSettings -> Bool
$c== :: HlsId3SegmentTaggingScheduleActionSettings
-> HlsId3SegmentTaggingScheduleActionSettings -> Bool
Prelude.Eq, ReadPrec [HlsId3SegmentTaggingScheduleActionSettings]
ReadPrec HlsId3SegmentTaggingScheduleActionSettings
Int -> ReadS HlsId3SegmentTaggingScheduleActionSettings
ReadS [HlsId3SegmentTaggingScheduleActionSettings]
(Int -> ReadS HlsId3SegmentTaggingScheduleActionSettings)
-> ReadS [HlsId3SegmentTaggingScheduleActionSettings]
-> ReadPrec HlsId3SegmentTaggingScheduleActionSettings
-> ReadPrec [HlsId3SegmentTaggingScheduleActionSettings]
-> Read HlsId3SegmentTaggingScheduleActionSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [HlsId3SegmentTaggingScheduleActionSettings]
$creadListPrec :: ReadPrec [HlsId3SegmentTaggingScheduleActionSettings]
readPrec :: ReadPrec HlsId3SegmentTaggingScheduleActionSettings
$creadPrec :: ReadPrec HlsId3SegmentTaggingScheduleActionSettings
readList :: ReadS [HlsId3SegmentTaggingScheduleActionSettings]
$creadList :: ReadS [HlsId3SegmentTaggingScheduleActionSettings]
readsPrec :: Int -> ReadS HlsId3SegmentTaggingScheduleActionSettings
$creadsPrec :: Int -> ReadS HlsId3SegmentTaggingScheduleActionSettings
Prelude.Read, Int -> HlsId3SegmentTaggingScheduleActionSettings -> ShowS
[HlsId3SegmentTaggingScheduleActionSettings] -> ShowS
HlsId3SegmentTaggingScheduleActionSettings -> String
(Int -> HlsId3SegmentTaggingScheduleActionSettings -> ShowS)
-> (HlsId3SegmentTaggingScheduleActionSettings -> String)
-> ([HlsId3SegmentTaggingScheduleActionSettings] -> ShowS)
-> Show HlsId3SegmentTaggingScheduleActionSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HlsId3SegmentTaggingScheduleActionSettings] -> ShowS
$cshowList :: [HlsId3SegmentTaggingScheduleActionSettings] -> ShowS
show :: HlsId3SegmentTaggingScheduleActionSettings -> String
$cshow :: HlsId3SegmentTaggingScheduleActionSettings -> String
showsPrec :: Int -> HlsId3SegmentTaggingScheduleActionSettings -> ShowS
$cshowsPrec :: Int -> HlsId3SegmentTaggingScheduleActionSettings -> ShowS
Prelude.Show, (forall x.
 HlsId3SegmentTaggingScheduleActionSettings
 -> Rep HlsId3SegmentTaggingScheduleActionSettings x)
-> (forall x.
    Rep HlsId3SegmentTaggingScheduleActionSettings x
    -> HlsId3SegmentTaggingScheduleActionSettings)
-> Generic HlsId3SegmentTaggingScheduleActionSettings
forall x.
Rep HlsId3SegmentTaggingScheduleActionSettings x
-> HlsId3SegmentTaggingScheduleActionSettings
forall x.
HlsId3SegmentTaggingScheduleActionSettings
-> Rep HlsId3SegmentTaggingScheduleActionSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep HlsId3SegmentTaggingScheduleActionSettings x
-> HlsId3SegmentTaggingScheduleActionSettings
$cfrom :: forall x.
HlsId3SegmentTaggingScheduleActionSettings
-> Rep HlsId3SegmentTaggingScheduleActionSettings x
Prelude.Generic)

-- |
-- Create a value of 'HlsId3SegmentTaggingScheduleActionSettings' 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:
--
-- 'tag', 'hlsId3SegmentTaggingScheduleActionSettings_tag' - ID3 tag to insert into each segment. Supports special keyword
-- identifiers to substitute in segment-related values.\\nSupported keyword
-- identifiers:
-- https:\/\/docs.aws.amazon.com\/medialive\/latest\/ug\/variable-data-identifiers.html
newHlsId3SegmentTaggingScheduleActionSettings ::
  -- | 'tag'
  Prelude.Text ->
  HlsId3SegmentTaggingScheduleActionSettings
newHlsId3SegmentTaggingScheduleActionSettings :: Text -> HlsId3SegmentTaggingScheduleActionSettings
newHlsId3SegmentTaggingScheduleActionSettings Text
pTag_ =
  HlsId3SegmentTaggingScheduleActionSettings' :: Text -> HlsId3SegmentTaggingScheduleActionSettings
HlsId3SegmentTaggingScheduleActionSettings'
    { $sel:tag:HlsId3SegmentTaggingScheduleActionSettings' :: Text
tag =
        Text
pTag_
    }

-- | ID3 tag to insert into each segment. Supports special keyword
-- identifiers to substitute in segment-related values.\\nSupported keyword
-- identifiers:
-- https:\/\/docs.aws.amazon.com\/medialive\/latest\/ug\/variable-data-identifiers.html
hlsId3SegmentTaggingScheduleActionSettings_tag :: Lens.Lens' HlsId3SegmentTaggingScheduleActionSettings Prelude.Text
hlsId3SegmentTaggingScheduleActionSettings_tag :: (Text -> f Text)
-> HlsId3SegmentTaggingScheduleActionSettings
-> f HlsId3SegmentTaggingScheduleActionSettings
hlsId3SegmentTaggingScheduleActionSettings_tag = (HlsId3SegmentTaggingScheduleActionSettings -> Text)
-> (HlsId3SegmentTaggingScheduleActionSettings
    -> Text -> HlsId3SegmentTaggingScheduleActionSettings)
-> Lens
     HlsId3SegmentTaggingScheduleActionSettings
     HlsId3SegmentTaggingScheduleActionSettings
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\HlsId3SegmentTaggingScheduleActionSettings' {Text
tag :: Text
$sel:tag:HlsId3SegmentTaggingScheduleActionSettings' :: HlsId3SegmentTaggingScheduleActionSettings -> Text
tag} -> Text
tag) (\s :: HlsId3SegmentTaggingScheduleActionSettings
s@HlsId3SegmentTaggingScheduleActionSettings' {} Text
a -> HlsId3SegmentTaggingScheduleActionSettings
s {$sel:tag:HlsId3SegmentTaggingScheduleActionSettings' :: Text
tag = Text
a} :: HlsId3SegmentTaggingScheduleActionSettings)

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

instance
  Prelude.Hashable
    HlsId3SegmentTaggingScheduleActionSettings

instance
  Prelude.NFData
    HlsId3SegmentTaggingScheduleActionSettings

instance
  Core.ToJSON
    HlsId3SegmentTaggingScheduleActionSettings
  where
  toJSON :: HlsId3SegmentTaggingScheduleActionSettings -> Value
toJSON
    HlsId3SegmentTaggingScheduleActionSettings' {Text
tag :: Text
$sel:tag:HlsId3SegmentTaggingScheduleActionSettings' :: HlsId3SegmentTaggingScheduleActionSettings -> Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"tag" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
tag)]
        )