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

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaConvert.Types.MxfAfdSignaling
import Amazonka.MediaConvert.Types.MxfProfile
import Amazonka.MediaConvert.Types.MxfXavcProfileSettings
import qualified Amazonka.Prelude as Prelude

-- | These settings relate to your MXF output container.
--
-- /See:/ 'newMxfSettings' smart constructor.
data MxfSettings = MxfSettings'
  { -- | Specify the XAVC profile settings for MXF outputs when you set your MXF
    -- profile to XAVC.
    MxfSettings -> Maybe MxfXavcProfileSettings
xavcProfileSettings :: Prelude.Maybe MxfXavcProfileSettings,
    -- | Optional. When you have AFD signaling set up in your output video
    -- stream, use this setting to choose whether to also include it in the MXF
    -- wrapper. Choose Don\'t copy (NO_COPY) to exclude AFD signaling from the
    -- MXF wrapper. Choose Copy from video stream (COPY_FROM_VIDEO) to copy the
    -- AFD values from the video stream for this output to the MXF wrapper.
    -- Regardless of which option you choose, the AFD values remain in the
    -- video stream. Related settings: To set up your output to include or
    -- exclude AFD values, see AfdSignaling, under VideoDescription. On the
    -- console, find AFD signaling under the output\'s video encoding settings.
    MxfSettings -> Maybe MxfAfdSignaling
afdSignaling :: Prelude.Maybe MxfAfdSignaling,
    -- | Specify the MXF profile, also called shim, for this output. When you
    -- choose Auto, MediaConvert chooses a profile based on the video codec and
    -- resolution. For a list of codecs supported with each MXF profile, see
    -- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/codecs-supported-with-each-mxf-profile.html.
    -- For more information about the automatic selection behavior, see
    -- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/default-automatic-selection-of-mxf-profiles.html.
    MxfSettings -> Maybe MxfProfile
profile :: Prelude.Maybe MxfProfile
  }
  deriving (MxfSettings -> MxfSettings -> Bool
(MxfSettings -> MxfSettings -> Bool)
-> (MxfSettings -> MxfSettings -> Bool) -> Eq MxfSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MxfSettings -> MxfSettings -> Bool
$c/= :: MxfSettings -> MxfSettings -> Bool
== :: MxfSettings -> MxfSettings -> Bool
$c== :: MxfSettings -> MxfSettings -> Bool
Prelude.Eq, ReadPrec [MxfSettings]
ReadPrec MxfSettings
Int -> ReadS MxfSettings
ReadS [MxfSettings]
(Int -> ReadS MxfSettings)
-> ReadS [MxfSettings]
-> ReadPrec MxfSettings
-> ReadPrec [MxfSettings]
-> Read MxfSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MxfSettings]
$creadListPrec :: ReadPrec [MxfSettings]
readPrec :: ReadPrec MxfSettings
$creadPrec :: ReadPrec MxfSettings
readList :: ReadS [MxfSettings]
$creadList :: ReadS [MxfSettings]
readsPrec :: Int -> ReadS MxfSettings
$creadsPrec :: Int -> ReadS MxfSettings
Prelude.Read, Int -> MxfSettings -> ShowS
[MxfSettings] -> ShowS
MxfSettings -> String
(Int -> MxfSettings -> ShowS)
-> (MxfSettings -> String)
-> ([MxfSettings] -> ShowS)
-> Show MxfSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MxfSettings] -> ShowS
$cshowList :: [MxfSettings] -> ShowS
show :: MxfSettings -> String
$cshow :: MxfSettings -> String
showsPrec :: Int -> MxfSettings -> ShowS
$cshowsPrec :: Int -> MxfSettings -> ShowS
Prelude.Show, (forall x. MxfSettings -> Rep MxfSettings x)
-> (forall x. Rep MxfSettings x -> MxfSettings)
-> Generic MxfSettings
forall x. Rep MxfSettings x -> MxfSettings
forall x. MxfSettings -> Rep MxfSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MxfSettings x -> MxfSettings
$cfrom :: forall x. MxfSettings -> Rep MxfSettings x
Prelude.Generic)

-- |
-- Create a value of 'MxfSettings' 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:
--
-- 'xavcProfileSettings', 'mxfSettings_xavcProfileSettings' - Specify the XAVC profile settings for MXF outputs when you set your MXF
-- profile to XAVC.
--
-- 'afdSignaling', 'mxfSettings_afdSignaling' - Optional. When you have AFD signaling set up in your output video
-- stream, use this setting to choose whether to also include it in the MXF
-- wrapper. Choose Don\'t copy (NO_COPY) to exclude AFD signaling from the
-- MXF wrapper. Choose Copy from video stream (COPY_FROM_VIDEO) to copy the
-- AFD values from the video stream for this output to the MXF wrapper.
-- Regardless of which option you choose, the AFD values remain in the
-- video stream. Related settings: To set up your output to include or
-- exclude AFD values, see AfdSignaling, under VideoDescription. On the
-- console, find AFD signaling under the output\'s video encoding settings.
--
-- 'profile', 'mxfSettings_profile' - Specify the MXF profile, also called shim, for this output. When you
-- choose Auto, MediaConvert chooses a profile based on the video codec and
-- resolution. For a list of codecs supported with each MXF profile, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/codecs-supported-with-each-mxf-profile.html.
-- For more information about the automatic selection behavior, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/default-automatic-selection-of-mxf-profiles.html.
newMxfSettings ::
  MxfSettings
newMxfSettings :: MxfSettings
newMxfSettings =
  MxfSettings' :: Maybe MxfXavcProfileSettings
-> Maybe MxfAfdSignaling -> Maybe MxfProfile -> MxfSettings
MxfSettings'
    { $sel:xavcProfileSettings:MxfSettings' :: Maybe MxfXavcProfileSettings
xavcProfileSettings = Maybe MxfXavcProfileSettings
forall a. Maybe a
Prelude.Nothing,
      $sel:afdSignaling:MxfSettings' :: Maybe MxfAfdSignaling
afdSignaling = Maybe MxfAfdSignaling
forall a. Maybe a
Prelude.Nothing,
      $sel:profile:MxfSettings' :: Maybe MxfProfile
profile = Maybe MxfProfile
forall a. Maybe a
Prelude.Nothing
    }

-- | Specify the XAVC profile settings for MXF outputs when you set your MXF
-- profile to XAVC.
mxfSettings_xavcProfileSettings :: Lens.Lens' MxfSettings (Prelude.Maybe MxfXavcProfileSettings)
mxfSettings_xavcProfileSettings :: (Maybe MxfXavcProfileSettings -> f (Maybe MxfXavcProfileSettings))
-> MxfSettings -> f MxfSettings
mxfSettings_xavcProfileSettings = (MxfSettings -> Maybe MxfXavcProfileSettings)
-> (MxfSettings -> Maybe MxfXavcProfileSettings -> MxfSettings)
-> Lens
     MxfSettings
     MxfSettings
     (Maybe MxfXavcProfileSettings)
     (Maybe MxfXavcProfileSettings)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MxfSettings' {Maybe MxfXavcProfileSettings
xavcProfileSettings :: Maybe MxfXavcProfileSettings
$sel:xavcProfileSettings:MxfSettings' :: MxfSettings -> Maybe MxfXavcProfileSettings
xavcProfileSettings} -> Maybe MxfXavcProfileSettings
xavcProfileSettings) (\s :: MxfSettings
s@MxfSettings' {} Maybe MxfXavcProfileSettings
a -> MxfSettings
s {$sel:xavcProfileSettings:MxfSettings' :: Maybe MxfXavcProfileSettings
xavcProfileSettings = Maybe MxfXavcProfileSettings
a} :: MxfSettings)

-- | Optional. When you have AFD signaling set up in your output video
-- stream, use this setting to choose whether to also include it in the MXF
-- wrapper. Choose Don\'t copy (NO_COPY) to exclude AFD signaling from the
-- MXF wrapper. Choose Copy from video stream (COPY_FROM_VIDEO) to copy the
-- AFD values from the video stream for this output to the MXF wrapper.
-- Regardless of which option you choose, the AFD values remain in the
-- video stream. Related settings: To set up your output to include or
-- exclude AFD values, see AfdSignaling, under VideoDescription. On the
-- console, find AFD signaling under the output\'s video encoding settings.
mxfSettings_afdSignaling :: Lens.Lens' MxfSettings (Prelude.Maybe MxfAfdSignaling)
mxfSettings_afdSignaling :: (Maybe MxfAfdSignaling -> f (Maybe MxfAfdSignaling))
-> MxfSettings -> f MxfSettings
mxfSettings_afdSignaling = (MxfSettings -> Maybe MxfAfdSignaling)
-> (MxfSettings -> Maybe MxfAfdSignaling -> MxfSettings)
-> Lens
     MxfSettings
     MxfSettings
     (Maybe MxfAfdSignaling)
     (Maybe MxfAfdSignaling)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MxfSettings' {Maybe MxfAfdSignaling
afdSignaling :: Maybe MxfAfdSignaling
$sel:afdSignaling:MxfSettings' :: MxfSettings -> Maybe MxfAfdSignaling
afdSignaling} -> Maybe MxfAfdSignaling
afdSignaling) (\s :: MxfSettings
s@MxfSettings' {} Maybe MxfAfdSignaling
a -> MxfSettings
s {$sel:afdSignaling:MxfSettings' :: Maybe MxfAfdSignaling
afdSignaling = Maybe MxfAfdSignaling
a} :: MxfSettings)

-- | Specify the MXF profile, also called shim, for this output. When you
-- choose Auto, MediaConvert chooses a profile based on the video codec and
-- resolution. For a list of codecs supported with each MXF profile, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/codecs-supported-with-each-mxf-profile.html.
-- For more information about the automatic selection behavior, see
-- https:\/\/docs.aws.amazon.com\/mediaconvert\/latest\/ug\/default-automatic-selection-of-mxf-profiles.html.
mxfSettings_profile :: Lens.Lens' MxfSettings (Prelude.Maybe MxfProfile)
mxfSettings_profile :: (Maybe MxfProfile -> f (Maybe MxfProfile))
-> MxfSettings -> f MxfSettings
mxfSettings_profile = (MxfSettings -> Maybe MxfProfile)
-> (MxfSettings -> Maybe MxfProfile -> MxfSettings)
-> Lens
     MxfSettings MxfSettings (Maybe MxfProfile) (Maybe MxfProfile)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MxfSettings' {Maybe MxfProfile
profile :: Maybe MxfProfile
$sel:profile:MxfSettings' :: MxfSettings -> Maybe MxfProfile
profile} -> Maybe MxfProfile
profile) (\s :: MxfSettings
s@MxfSettings' {} Maybe MxfProfile
a -> MxfSettings
s {$sel:profile:MxfSettings' :: Maybe MxfProfile
profile = Maybe MxfProfile
a} :: MxfSettings)

instance Core.FromJSON MxfSettings where
  parseJSON :: Value -> Parser MxfSettings
parseJSON =
    String
-> (Object -> Parser MxfSettings) -> Value -> Parser MxfSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MxfSettings"
      ( \Object
x ->
          Maybe MxfXavcProfileSettings
-> Maybe MxfAfdSignaling -> Maybe MxfProfile -> MxfSettings
MxfSettings'
            (Maybe MxfXavcProfileSettings
 -> Maybe MxfAfdSignaling -> Maybe MxfProfile -> MxfSettings)
-> Parser (Maybe MxfXavcProfileSettings)
-> Parser
     (Maybe MxfAfdSignaling -> Maybe MxfProfile -> MxfSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe MxfXavcProfileSettings)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"xavcProfileSettings")
            Parser (Maybe MxfAfdSignaling -> Maybe MxfProfile -> MxfSettings)
-> Parser (Maybe MxfAfdSignaling)
-> Parser (Maybe MxfProfile -> MxfSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MxfAfdSignaling)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"afdSignaling")
            Parser (Maybe MxfProfile -> MxfSettings)
-> Parser (Maybe MxfProfile) -> Parser MxfSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe MxfProfile)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"profile")
      )

instance Prelude.Hashable MxfSettings

instance Prelude.NFData MxfSettings

instance Core.ToJSON MxfSettings where
  toJSON :: MxfSettings -> Value
toJSON MxfSettings' {Maybe MxfAfdSignaling
Maybe MxfProfile
Maybe MxfXavcProfileSettings
profile :: Maybe MxfProfile
afdSignaling :: Maybe MxfAfdSignaling
xavcProfileSettings :: Maybe MxfXavcProfileSettings
$sel:profile:MxfSettings' :: MxfSettings -> Maybe MxfProfile
$sel:afdSignaling:MxfSettings' :: MxfSettings -> Maybe MxfAfdSignaling
$sel:xavcProfileSettings:MxfSettings' :: MxfSettings -> Maybe MxfXavcProfileSettings
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"xavcProfileSettings" Text -> MxfXavcProfileSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MxfXavcProfileSettings -> Pair)
-> Maybe MxfXavcProfileSettings -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MxfXavcProfileSettings
xavcProfileSettings,
            (Text
"afdSignaling" Text -> MxfAfdSignaling -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MxfAfdSignaling -> Pair) -> Maybe MxfAfdSignaling -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MxfAfdSignaling
afdSignaling,
            (Text
"profile" Text -> MxfProfile -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (MxfProfile -> Pair) -> Maybe MxfProfile -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MxfProfile
profile
          ]
      )