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

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

-- | Ms Smooth Output Settings
--
-- /See:/ 'newMsSmoothOutputSettings' smart constructor.
data MsSmoothOutputSettings = MsSmoothOutputSettings'
  { -- | Only applicable when this output is referencing an H.265 video
    -- description. Specifies whether MP4 segments should be packaged as HEV1
    -- or HVC1.
    MsSmoothOutputSettings -> Maybe MsSmoothH265PackagingType
h265PackagingType :: Prelude.Maybe MsSmoothH265PackagingType,
    -- | String concatenated to the end of the destination filename. Required for
    -- multiple outputs of the same type.
    MsSmoothOutputSettings -> Maybe Text
nameModifier :: Prelude.Maybe Prelude.Text
  }
  deriving (MsSmoothOutputSettings -> MsSmoothOutputSettings -> Bool
(MsSmoothOutputSettings -> MsSmoothOutputSettings -> Bool)
-> (MsSmoothOutputSettings -> MsSmoothOutputSettings -> Bool)
-> Eq MsSmoothOutputSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MsSmoothOutputSettings -> MsSmoothOutputSettings -> Bool
$c/= :: MsSmoothOutputSettings -> MsSmoothOutputSettings -> Bool
== :: MsSmoothOutputSettings -> MsSmoothOutputSettings -> Bool
$c== :: MsSmoothOutputSettings -> MsSmoothOutputSettings -> Bool
Prelude.Eq, ReadPrec [MsSmoothOutputSettings]
ReadPrec MsSmoothOutputSettings
Int -> ReadS MsSmoothOutputSettings
ReadS [MsSmoothOutputSettings]
(Int -> ReadS MsSmoothOutputSettings)
-> ReadS [MsSmoothOutputSettings]
-> ReadPrec MsSmoothOutputSettings
-> ReadPrec [MsSmoothOutputSettings]
-> Read MsSmoothOutputSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MsSmoothOutputSettings]
$creadListPrec :: ReadPrec [MsSmoothOutputSettings]
readPrec :: ReadPrec MsSmoothOutputSettings
$creadPrec :: ReadPrec MsSmoothOutputSettings
readList :: ReadS [MsSmoothOutputSettings]
$creadList :: ReadS [MsSmoothOutputSettings]
readsPrec :: Int -> ReadS MsSmoothOutputSettings
$creadsPrec :: Int -> ReadS MsSmoothOutputSettings
Prelude.Read, Int -> MsSmoothOutputSettings -> ShowS
[MsSmoothOutputSettings] -> ShowS
MsSmoothOutputSettings -> String
(Int -> MsSmoothOutputSettings -> ShowS)
-> (MsSmoothOutputSettings -> String)
-> ([MsSmoothOutputSettings] -> ShowS)
-> Show MsSmoothOutputSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MsSmoothOutputSettings] -> ShowS
$cshowList :: [MsSmoothOutputSettings] -> ShowS
show :: MsSmoothOutputSettings -> String
$cshow :: MsSmoothOutputSettings -> String
showsPrec :: Int -> MsSmoothOutputSettings -> ShowS
$cshowsPrec :: Int -> MsSmoothOutputSettings -> ShowS
Prelude.Show, (forall x. MsSmoothOutputSettings -> Rep MsSmoothOutputSettings x)
-> (forall x.
    Rep MsSmoothOutputSettings x -> MsSmoothOutputSettings)
-> Generic MsSmoothOutputSettings
forall x. Rep MsSmoothOutputSettings x -> MsSmoothOutputSettings
forall x. MsSmoothOutputSettings -> Rep MsSmoothOutputSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MsSmoothOutputSettings x -> MsSmoothOutputSettings
$cfrom :: forall x. MsSmoothOutputSettings -> Rep MsSmoothOutputSettings x
Prelude.Generic)

-- |
-- Create a value of 'MsSmoothOutputSettings' 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:
--
-- 'h265PackagingType', 'msSmoothOutputSettings_h265PackagingType' - Only applicable when this output is referencing an H.265 video
-- description. Specifies whether MP4 segments should be packaged as HEV1
-- or HVC1.
--
-- 'nameModifier', 'msSmoothOutputSettings_nameModifier' - String concatenated to the end of the destination filename. Required for
-- multiple outputs of the same type.
newMsSmoothOutputSettings ::
  MsSmoothOutputSettings
newMsSmoothOutputSettings :: MsSmoothOutputSettings
newMsSmoothOutputSettings =
  MsSmoothOutputSettings' :: Maybe MsSmoothH265PackagingType
-> Maybe Text -> MsSmoothOutputSettings
MsSmoothOutputSettings'
    { $sel:h265PackagingType:MsSmoothOutputSettings' :: Maybe MsSmoothH265PackagingType
h265PackagingType =
        Maybe MsSmoothH265PackagingType
forall a. Maybe a
Prelude.Nothing,
      $sel:nameModifier:MsSmoothOutputSettings' :: Maybe Text
nameModifier = Maybe Text
forall a. Maybe a
Prelude.Nothing
    }

-- | Only applicable when this output is referencing an H.265 video
-- description. Specifies whether MP4 segments should be packaged as HEV1
-- or HVC1.
msSmoothOutputSettings_h265PackagingType :: Lens.Lens' MsSmoothOutputSettings (Prelude.Maybe MsSmoothH265PackagingType)
msSmoothOutputSettings_h265PackagingType :: (Maybe MsSmoothH265PackagingType
 -> f (Maybe MsSmoothH265PackagingType))
-> MsSmoothOutputSettings -> f MsSmoothOutputSettings
msSmoothOutputSettings_h265PackagingType = (MsSmoothOutputSettings -> Maybe MsSmoothH265PackagingType)
-> (MsSmoothOutputSettings
    -> Maybe MsSmoothH265PackagingType -> MsSmoothOutputSettings)
-> Lens
     MsSmoothOutputSettings
     MsSmoothOutputSettings
     (Maybe MsSmoothH265PackagingType)
     (Maybe MsSmoothH265PackagingType)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MsSmoothOutputSettings' {Maybe MsSmoothH265PackagingType
h265PackagingType :: Maybe MsSmoothH265PackagingType
$sel:h265PackagingType:MsSmoothOutputSettings' :: MsSmoothOutputSettings -> Maybe MsSmoothH265PackagingType
h265PackagingType} -> Maybe MsSmoothH265PackagingType
h265PackagingType) (\s :: MsSmoothOutputSettings
s@MsSmoothOutputSettings' {} Maybe MsSmoothH265PackagingType
a -> MsSmoothOutputSettings
s {$sel:h265PackagingType:MsSmoothOutputSettings' :: Maybe MsSmoothH265PackagingType
h265PackagingType = Maybe MsSmoothH265PackagingType
a} :: MsSmoothOutputSettings)

-- | String concatenated to the end of the destination filename. Required for
-- multiple outputs of the same type.
msSmoothOutputSettings_nameModifier :: Lens.Lens' MsSmoothOutputSettings (Prelude.Maybe Prelude.Text)
msSmoothOutputSettings_nameModifier :: (Maybe Text -> f (Maybe Text))
-> MsSmoothOutputSettings -> f MsSmoothOutputSettings
msSmoothOutputSettings_nameModifier = (MsSmoothOutputSettings -> Maybe Text)
-> (MsSmoothOutputSettings -> Maybe Text -> MsSmoothOutputSettings)
-> Lens
     MsSmoothOutputSettings
     MsSmoothOutputSettings
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MsSmoothOutputSettings' {Maybe Text
nameModifier :: Maybe Text
$sel:nameModifier:MsSmoothOutputSettings' :: MsSmoothOutputSettings -> Maybe Text
nameModifier} -> Maybe Text
nameModifier) (\s :: MsSmoothOutputSettings
s@MsSmoothOutputSettings' {} Maybe Text
a -> MsSmoothOutputSettings
s {$sel:nameModifier:MsSmoothOutputSettings' :: Maybe Text
nameModifier = Maybe Text
a} :: MsSmoothOutputSettings)

instance Core.FromJSON MsSmoothOutputSettings where
  parseJSON :: Value -> Parser MsSmoothOutputSettings
parseJSON =
    String
-> (Object -> Parser MsSmoothOutputSettings)
-> Value
-> Parser MsSmoothOutputSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MsSmoothOutputSettings"
      ( \Object
x ->
          Maybe MsSmoothH265PackagingType
-> Maybe Text -> MsSmoothOutputSettings
MsSmoothOutputSettings'
            (Maybe MsSmoothH265PackagingType
 -> Maybe Text -> MsSmoothOutputSettings)
-> Parser (Maybe MsSmoothH265PackagingType)
-> Parser (Maybe Text -> MsSmoothOutputSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe MsSmoothH265PackagingType)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"h265PackagingType")
            Parser (Maybe Text -> MsSmoothOutputSettings)
-> Parser (Maybe Text) -> Parser MsSmoothOutputSettings
forall (f :: * -> *) a b. Applicative f => 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
"nameModifier")
      )

instance Prelude.Hashable MsSmoothOutputSettings

instance Prelude.NFData MsSmoothOutputSettings

instance Core.ToJSON MsSmoothOutputSettings where
  toJSON :: MsSmoothOutputSettings -> Value
toJSON MsSmoothOutputSettings' {Maybe Text
Maybe MsSmoothH265PackagingType
nameModifier :: Maybe Text
h265PackagingType :: Maybe MsSmoothH265PackagingType
$sel:nameModifier:MsSmoothOutputSettings' :: MsSmoothOutputSettings -> Maybe Text
$sel:h265PackagingType:MsSmoothOutputSettings' :: MsSmoothOutputSettings -> Maybe MsSmoothH265PackagingType
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"h265PackagingType" Text -> MsSmoothH265PackagingType -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MsSmoothH265PackagingType -> Pair)
-> Maybe MsSmoothH265PackagingType -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MsSmoothH265PackagingType
h265PackagingType,
            (Text
"nameModifier" 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
nameModifier
          ]
      )