{-# 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.MediaConvert.Types.MsSmoothAdditionalManifest
-- 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.MediaConvert.Types.MsSmoothAdditionalManifest where

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

-- | Specify the details for each additional Microsoft Smooth Streaming
-- manifest that you want the service to generate for this output group.
-- Each manifest can reference a different subset of outputs in the group.
--
-- /See:/ 'newMsSmoothAdditionalManifest' smart constructor.
data MsSmoothAdditionalManifest = MsSmoothAdditionalManifest'
  { -- | Specify a name modifier that the service adds to the name of this
    -- manifest to make it different from the file names of the other main
    -- manifests in the output group. For example, say that the default main
    -- manifest for your Microsoft Smooth group is film-name.ismv. If you enter
    -- \"-no-premium\" for this setting, then the file name the service
    -- generates for this top-level manifest is film-name-no-premium.ismv.
    MsSmoothAdditionalManifest -> Maybe Text
manifestNameModifier :: Prelude.Maybe Prelude.Text,
    -- | Specify the outputs that you want this additional top-level manifest to
    -- reference.
    MsSmoothAdditionalManifest -> Maybe [Text]
selectedOutputs :: Prelude.Maybe [Prelude.Text]
  }
  deriving (MsSmoothAdditionalManifest -> MsSmoothAdditionalManifest -> Bool
(MsSmoothAdditionalManifest -> MsSmoothAdditionalManifest -> Bool)
-> (MsSmoothAdditionalManifest
    -> MsSmoothAdditionalManifest -> Bool)
-> Eq MsSmoothAdditionalManifest
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MsSmoothAdditionalManifest -> MsSmoothAdditionalManifest -> Bool
$c/= :: MsSmoothAdditionalManifest -> MsSmoothAdditionalManifest -> Bool
== :: MsSmoothAdditionalManifest -> MsSmoothAdditionalManifest -> Bool
$c== :: MsSmoothAdditionalManifest -> MsSmoothAdditionalManifest -> Bool
Prelude.Eq, ReadPrec [MsSmoothAdditionalManifest]
ReadPrec MsSmoothAdditionalManifest
Int -> ReadS MsSmoothAdditionalManifest
ReadS [MsSmoothAdditionalManifest]
(Int -> ReadS MsSmoothAdditionalManifest)
-> ReadS [MsSmoothAdditionalManifest]
-> ReadPrec MsSmoothAdditionalManifest
-> ReadPrec [MsSmoothAdditionalManifest]
-> Read MsSmoothAdditionalManifest
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MsSmoothAdditionalManifest]
$creadListPrec :: ReadPrec [MsSmoothAdditionalManifest]
readPrec :: ReadPrec MsSmoothAdditionalManifest
$creadPrec :: ReadPrec MsSmoothAdditionalManifest
readList :: ReadS [MsSmoothAdditionalManifest]
$creadList :: ReadS [MsSmoothAdditionalManifest]
readsPrec :: Int -> ReadS MsSmoothAdditionalManifest
$creadsPrec :: Int -> ReadS MsSmoothAdditionalManifest
Prelude.Read, Int -> MsSmoothAdditionalManifest -> ShowS
[MsSmoothAdditionalManifest] -> ShowS
MsSmoothAdditionalManifest -> String
(Int -> MsSmoothAdditionalManifest -> ShowS)
-> (MsSmoothAdditionalManifest -> String)
-> ([MsSmoothAdditionalManifest] -> ShowS)
-> Show MsSmoothAdditionalManifest
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MsSmoothAdditionalManifest] -> ShowS
$cshowList :: [MsSmoothAdditionalManifest] -> ShowS
show :: MsSmoothAdditionalManifest -> String
$cshow :: MsSmoothAdditionalManifest -> String
showsPrec :: Int -> MsSmoothAdditionalManifest -> ShowS
$cshowsPrec :: Int -> MsSmoothAdditionalManifest -> ShowS
Prelude.Show, (forall x.
 MsSmoothAdditionalManifest -> Rep MsSmoothAdditionalManifest x)
-> (forall x.
    Rep MsSmoothAdditionalManifest x -> MsSmoothAdditionalManifest)
-> Generic MsSmoothAdditionalManifest
forall x.
Rep MsSmoothAdditionalManifest x -> MsSmoothAdditionalManifest
forall x.
MsSmoothAdditionalManifest -> Rep MsSmoothAdditionalManifest x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MsSmoothAdditionalManifest x -> MsSmoothAdditionalManifest
$cfrom :: forall x.
MsSmoothAdditionalManifest -> Rep MsSmoothAdditionalManifest x
Prelude.Generic)

-- |
-- Create a value of 'MsSmoothAdditionalManifest' 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:
--
-- 'manifestNameModifier', 'msSmoothAdditionalManifest_manifestNameModifier' - Specify a name modifier that the service adds to the name of this
-- manifest to make it different from the file names of the other main
-- manifests in the output group. For example, say that the default main
-- manifest for your Microsoft Smooth group is film-name.ismv. If you enter
-- \"-no-premium\" for this setting, then the file name the service
-- generates for this top-level manifest is film-name-no-premium.ismv.
--
-- 'selectedOutputs', 'msSmoothAdditionalManifest_selectedOutputs' - Specify the outputs that you want this additional top-level manifest to
-- reference.
newMsSmoothAdditionalManifest ::
  MsSmoothAdditionalManifest
newMsSmoothAdditionalManifest :: MsSmoothAdditionalManifest
newMsSmoothAdditionalManifest =
  MsSmoothAdditionalManifest' :: Maybe Text -> Maybe [Text] -> MsSmoothAdditionalManifest
MsSmoothAdditionalManifest'
    { $sel:manifestNameModifier:MsSmoothAdditionalManifest' :: Maybe Text
manifestNameModifier =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:selectedOutputs:MsSmoothAdditionalManifest' :: Maybe [Text]
selectedOutputs = Maybe [Text]
forall a. Maybe a
Prelude.Nothing
    }

-- | Specify a name modifier that the service adds to the name of this
-- manifest to make it different from the file names of the other main
-- manifests in the output group. For example, say that the default main
-- manifest for your Microsoft Smooth group is film-name.ismv. If you enter
-- \"-no-premium\" for this setting, then the file name the service
-- generates for this top-level manifest is film-name-no-premium.ismv.
msSmoothAdditionalManifest_manifestNameModifier :: Lens.Lens' MsSmoothAdditionalManifest (Prelude.Maybe Prelude.Text)
msSmoothAdditionalManifest_manifestNameModifier :: (Maybe Text -> f (Maybe Text))
-> MsSmoothAdditionalManifest -> f MsSmoothAdditionalManifest
msSmoothAdditionalManifest_manifestNameModifier = (MsSmoothAdditionalManifest -> Maybe Text)
-> (MsSmoothAdditionalManifest
    -> Maybe Text -> MsSmoothAdditionalManifest)
-> Lens
     MsSmoothAdditionalManifest
     MsSmoothAdditionalManifest
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MsSmoothAdditionalManifest' {Maybe Text
manifestNameModifier :: Maybe Text
$sel:manifestNameModifier:MsSmoothAdditionalManifest' :: MsSmoothAdditionalManifest -> Maybe Text
manifestNameModifier} -> Maybe Text
manifestNameModifier) (\s :: MsSmoothAdditionalManifest
s@MsSmoothAdditionalManifest' {} Maybe Text
a -> MsSmoothAdditionalManifest
s {$sel:manifestNameModifier:MsSmoothAdditionalManifest' :: Maybe Text
manifestNameModifier = Maybe Text
a} :: MsSmoothAdditionalManifest)

-- | Specify the outputs that you want this additional top-level manifest to
-- reference.
msSmoothAdditionalManifest_selectedOutputs :: Lens.Lens' MsSmoothAdditionalManifest (Prelude.Maybe [Prelude.Text])
msSmoothAdditionalManifest_selectedOutputs :: (Maybe [Text] -> f (Maybe [Text]))
-> MsSmoothAdditionalManifest -> f MsSmoothAdditionalManifest
msSmoothAdditionalManifest_selectedOutputs = (MsSmoothAdditionalManifest -> Maybe [Text])
-> (MsSmoothAdditionalManifest
    -> Maybe [Text] -> MsSmoothAdditionalManifest)
-> Lens
     MsSmoothAdditionalManifest
     MsSmoothAdditionalManifest
     (Maybe [Text])
     (Maybe [Text])
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MsSmoothAdditionalManifest' {Maybe [Text]
selectedOutputs :: Maybe [Text]
$sel:selectedOutputs:MsSmoothAdditionalManifest' :: MsSmoothAdditionalManifest -> Maybe [Text]
selectedOutputs} -> Maybe [Text]
selectedOutputs) (\s :: MsSmoothAdditionalManifest
s@MsSmoothAdditionalManifest' {} Maybe [Text]
a -> MsSmoothAdditionalManifest
s {$sel:selectedOutputs:MsSmoothAdditionalManifest' :: Maybe [Text]
selectedOutputs = Maybe [Text]
a} :: MsSmoothAdditionalManifest) ((Maybe [Text] -> f (Maybe [Text]))
 -> MsSmoothAdditionalManifest -> f MsSmoothAdditionalManifest)
-> ((Maybe [Text] -> f (Maybe [Text]))
    -> Maybe [Text] -> f (Maybe [Text]))
-> (Maybe [Text] -> f (Maybe [Text]))
-> MsSmoothAdditionalManifest
-> f MsSmoothAdditionalManifest
forall b c a. (b -> c) -> (a -> b) -> a -> c
Prelude.. AnIso [Text] [Text] [Text] [Text]
-> Iso (Maybe [Text]) (Maybe [Text]) (Maybe [Text]) (Maybe [Text])
forall (f :: * -> *) (g :: * -> *) s t a b.
(Functor f, Functor g) =>
AnIso s t a b -> Iso (f s) (g t) (f a) (g b)
Lens.mapping AnIso [Text] [Text] [Text] [Text]
forall s t a b. (Coercible s a, Coercible t b) => Iso s t a b
Lens.coerced

instance Core.FromJSON MsSmoothAdditionalManifest where
  parseJSON :: Value -> Parser MsSmoothAdditionalManifest
parseJSON =
    String
-> (Object -> Parser MsSmoothAdditionalManifest)
-> Value
-> Parser MsSmoothAdditionalManifest
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MsSmoothAdditionalManifest"
      ( \Object
x ->
          Maybe Text -> Maybe [Text] -> MsSmoothAdditionalManifest
MsSmoothAdditionalManifest'
            (Maybe Text -> Maybe [Text] -> MsSmoothAdditionalManifest)
-> Parser (Maybe Text)
-> Parser (Maybe [Text] -> MsSmoothAdditionalManifest)
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
"manifestNameModifier")
            Parser (Maybe [Text] -> MsSmoothAdditionalManifest)
-> Parser (Maybe [Text]) -> Parser MsSmoothAdditionalManifest
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> ( Object
x Object -> Text -> Parser (Maybe (Maybe [Text]))
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"selectedOutputs"
                            Parser (Maybe (Maybe [Text]))
-> Maybe [Text] -> Parser (Maybe [Text])
forall a. Parser (Maybe a) -> a -> Parser a
Core..!= Maybe [Text]
forall a. Monoid a => a
Prelude.mempty
                        )
      )

instance Prelude.Hashable MsSmoothAdditionalManifest

instance Prelude.NFData MsSmoothAdditionalManifest

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