{-# 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-2023 Brendan Hay
-- License     : Mozilla Public License, v. 2.0.
-- Maintainer  : Brendan Hay
-- Stability   : auto-generated
-- Portability : non-portable (GHC extensions)
module Amazonka.MediaConvert.Types.MxfSettings where

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
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'
  { -- | 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,
    -- | Specify the XAVC profile settings for MXF outputs when you set your MXF
    -- profile to XAVC.
    MxfSettings -> Maybe MxfXavcProfileSettings
xavcProfileSettings :: Prelude.Maybe MxfXavcProfileSettings
  }
  deriving (MxfSettings -> MxfSettings -> Bool
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]
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
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. 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:
--
-- '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.
--
-- 'xavcProfileSettings', 'mxfSettings_xavcProfileSettings' - Specify the XAVC profile settings for MXF outputs when you set your MXF
-- profile to XAVC.
newMxfSettings ::
  MxfSettings
newMxfSettings :: MxfSettings
newMxfSettings =
  MxfSettings'
    { $sel:afdSignaling:MxfSettings' :: Maybe MxfAfdSignaling
afdSignaling = forall a. Maybe a
Prelude.Nothing,
      $sel:profile:MxfSettings' :: Maybe MxfProfile
profile = forall a. Maybe a
Prelude.Nothing,
      $sel:xavcProfileSettings:MxfSettings' :: Maybe MxfXavcProfileSettings
xavcProfileSettings = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' MxfSettings (Maybe MxfAfdSignaling)
mxfSettings_afdSignaling = 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 :: Lens' MxfSettings (Maybe MxfProfile)
mxfSettings_profile = 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)

-- | 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 :: Lens' MxfSettings (Maybe MxfXavcProfileSettings)
mxfSettings_xavcProfileSettings = 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)

instance Data.FromJSON MxfSettings where
  parseJSON :: Value -> Parser MxfSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MxfSettings"
      ( \Object
x ->
          Maybe MxfAfdSignaling
-> Maybe MxfProfile -> Maybe MxfXavcProfileSettings -> MxfSettings
MxfSettings'
            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
"afdSignaling")
            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
"profile")
            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
"xavcProfileSettings")
      )

instance Prelude.Hashable MxfSettings where
  hashWithSalt :: Int -> MxfSettings -> Int
hashWithSalt Int
_salt MxfSettings' {Maybe MxfAfdSignaling
Maybe MxfProfile
Maybe MxfXavcProfileSettings
xavcProfileSettings :: Maybe MxfXavcProfileSettings
profile :: Maybe MxfProfile
afdSignaling :: Maybe MxfAfdSignaling
$sel:xavcProfileSettings:MxfSettings' :: MxfSettings -> Maybe MxfXavcProfileSettings
$sel:profile:MxfSettings' :: MxfSettings -> Maybe MxfProfile
$sel:afdSignaling:MxfSettings' :: MxfSettings -> Maybe MxfAfdSignaling
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MxfAfdSignaling
afdSignaling
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MxfProfile
profile
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe MxfXavcProfileSettings
xavcProfileSettings

instance Prelude.NFData MxfSettings where
  rnf :: MxfSettings -> ()
rnf MxfSettings' {Maybe MxfAfdSignaling
Maybe MxfProfile
Maybe MxfXavcProfileSettings
xavcProfileSettings :: Maybe MxfXavcProfileSettings
profile :: Maybe MxfProfile
afdSignaling :: Maybe MxfAfdSignaling
$sel:xavcProfileSettings:MxfSettings' :: MxfSettings -> Maybe MxfXavcProfileSettings
$sel:profile:MxfSettings' :: MxfSettings -> Maybe MxfProfile
$sel:afdSignaling:MxfSettings' :: MxfSettings -> Maybe MxfAfdSignaling
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe MxfAfdSignaling
afdSignaling
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MxfProfile
profile
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe MxfXavcProfileSettings
xavcProfileSettings

instance Data.ToJSON MxfSettings where
  toJSON :: MxfSettings -> Value
toJSON MxfSettings' {Maybe MxfAfdSignaling
Maybe MxfProfile
Maybe MxfXavcProfileSettings
xavcProfileSettings :: Maybe MxfXavcProfileSettings
profile :: Maybe MxfProfile
afdSignaling :: Maybe MxfAfdSignaling
$sel:xavcProfileSettings:MxfSettings' :: MxfSettings -> Maybe MxfXavcProfileSettings
$sel:profile:MxfSettings' :: MxfSettings -> Maybe MxfProfile
$sel:afdSignaling:MxfSettings' :: MxfSettings -> Maybe MxfAfdSignaling
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"afdSignaling" 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 MxfAfdSignaling
afdSignaling,
            (Key
"profile" 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 MxfProfile
profile,
            (Key
"xavcProfileSettings" 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 MxfXavcProfileSettings
xavcProfileSettings
          ]
      )