{-# 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-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.MsSmoothOutputSettings 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.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
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]
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
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. 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'
    { $sel:h265PackagingType:MsSmoothOutputSettings' :: Maybe MsSmoothH265PackagingType
h265PackagingType =
        forall a. Maybe a
Prelude.Nothing,
      $sel:nameModifier:MsSmoothOutputSettings' :: Maybe Text
nameModifier = 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 :: Lens' MsSmoothOutputSettings (Maybe MsSmoothH265PackagingType)
msSmoothOutputSettings_h265PackagingType = 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 :: Lens' MsSmoothOutputSettings (Maybe Text)
msSmoothOutputSettings_nameModifier = 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 Data.FromJSON MsSmoothOutputSettings where
  parseJSON :: Value -> Parser MsSmoothOutputSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MsSmoothOutputSettings"
      ( \Object
x ->
          Maybe MsSmoothH265PackagingType
-> Maybe Text -> MsSmoothOutputSettings
MsSmoothOutputSettings'
            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
"h265PackagingType")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"nameModifier")
      )

instance Prelude.Hashable MsSmoothOutputSettings where
  hashWithSalt :: Int -> MsSmoothOutputSettings -> Int
hashWithSalt Int
_salt MsSmoothOutputSettings' {Maybe Text
Maybe MsSmoothH265PackagingType
nameModifier :: Maybe Text
h265PackagingType :: Maybe MsSmoothH265PackagingType
$sel:nameModifier:MsSmoothOutputSettings' :: MsSmoothOutputSettings -> Maybe Text
$sel:h265PackagingType:MsSmoothOutputSettings' :: MsSmoothOutputSettings -> Maybe MsSmoothH265PackagingType
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MsSmoothH265PackagingType
h265PackagingType
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
nameModifier

instance Prelude.NFData MsSmoothOutputSettings where
  rnf :: MsSmoothOutputSettings -> ()
rnf MsSmoothOutputSettings' {Maybe Text
Maybe MsSmoothH265PackagingType
nameModifier :: Maybe Text
h265PackagingType :: Maybe MsSmoothH265PackagingType
$sel:nameModifier:MsSmoothOutputSettings' :: MsSmoothOutputSettings -> Maybe Text
$sel:h265PackagingType:MsSmoothOutputSettings' :: MsSmoothOutputSettings -> Maybe MsSmoothH265PackagingType
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe MsSmoothH265PackagingType
h265PackagingType
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nameModifier

instance Data.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
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"h265PackagingType" 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 MsSmoothH265PackagingType
h265PackagingType,
            (Key
"nameModifier" 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
nameModifier
          ]
      )