{-# 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.F4vSettings
-- 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.F4vSettings 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.F4vMoovPlacement
import qualified Amazonka.Prelude as Prelude

-- | Settings for F4v container
--
-- /See:/ 'newF4vSettings' smart constructor.
data F4vSettings = F4vSettings'
  { -- | If set to PROGRESSIVE_DOWNLOAD, the MOOV atom is relocated to the
    -- beginning of the archive as required for progressive downloading.
    -- Otherwise it is placed normally at the end.
    F4vSettings -> Maybe F4vMoovPlacement
moovPlacement :: Prelude.Maybe F4vMoovPlacement
  }
  deriving (F4vSettings -> F4vSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: F4vSettings -> F4vSettings -> Bool
$c/= :: F4vSettings -> F4vSettings -> Bool
== :: F4vSettings -> F4vSettings -> Bool
$c== :: F4vSettings -> F4vSettings -> Bool
Prelude.Eq, ReadPrec [F4vSettings]
ReadPrec F4vSettings
Int -> ReadS F4vSettings
ReadS [F4vSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [F4vSettings]
$creadListPrec :: ReadPrec [F4vSettings]
readPrec :: ReadPrec F4vSettings
$creadPrec :: ReadPrec F4vSettings
readList :: ReadS [F4vSettings]
$creadList :: ReadS [F4vSettings]
readsPrec :: Int -> ReadS F4vSettings
$creadsPrec :: Int -> ReadS F4vSettings
Prelude.Read, Int -> F4vSettings -> ShowS
[F4vSettings] -> ShowS
F4vSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [F4vSettings] -> ShowS
$cshowList :: [F4vSettings] -> ShowS
show :: F4vSettings -> String
$cshow :: F4vSettings -> String
showsPrec :: Int -> F4vSettings -> ShowS
$cshowsPrec :: Int -> F4vSettings -> ShowS
Prelude.Show, forall x. Rep F4vSettings x -> F4vSettings
forall x. F4vSettings -> Rep F4vSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep F4vSettings x -> F4vSettings
$cfrom :: forall x. F4vSettings -> Rep F4vSettings x
Prelude.Generic)

-- |
-- Create a value of 'F4vSettings' 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:
--
-- 'moovPlacement', 'f4vSettings_moovPlacement' - If set to PROGRESSIVE_DOWNLOAD, the MOOV atom is relocated to the
-- beginning of the archive as required for progressive downloading.
-- Otherwise it is placed normally at the end.
newF4vSettings ::
  F4vSettings
newF4vSettings :: F4vSettings
newF4vSettings =
  F4vSettings' {$sel:moovPlacement:F4vSettings' :: Maybe F4vMoovPlacement
moovPlacement = forall a. Maybe a
Prelude.Nothing}

-- | If set to PROGRESSIVE_DOWNLOAD, the MOOV atom is relocated to the
-- beginning of the archive as required for progressive downloading.
-- Otherwise it is placed normally at the end.
f4vSettings_moovPlacement :: Lens.Lens' F4vSettings (Prelude.Maybe F4vMoovPlacement)
f4vSettings_moovPlacement :: Lens' F4vSettings (Maybe F4vMoovPlacement)
f4vSettings_moovPlacement = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\F4vSettings' {Maybe F4vMoovPlacement
moovPlacement :: Maybe F4vMoovPlacement
$sel:moovPlacement:F4vSettings' :: F4vSettings -> Maybe F4vMoovPlacement
moovPlacement} -> Maybe F4vMoovPlacement
moovPlacement) (\s :: F4vSettings
s@F4vSettings' {} Maybe F4vMoovPlacement
a -> F4vSettings
s {$sel:moovPlacement:F4vSettings' :: Maybe F4vMoovPlacement
moovPlacement = Maybe F4vMoovPlacement
a} :: F4vSettings)

instance Data.FromJSON F4vSettings where
  parseJSON :: Value -> Parser F4vSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"F4vSettings"
      ( \Object
x ->
          Maybe F4vMoovPlacement -> F4vSettings
F4vSettings'
            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
"moovPlacement")
      )

instance Prelude.Hashable F4vSettings where
  hashWithSalt :: Int -> F4vSettings -> Int
hashWithSalt Int
_salt F4vSettings' {Maybe F4vMoovPlacement
moovPlacement :: Maybe F4vMoovPlacement
$sel:moovPlacement:F4vSettings' :: F4vSettings -> Maybe F4vMoovPlacement
..} =
    Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe F4vMoovPlacement
moovPlacement

instance Prelude.NFData F4vSettings where
  rnf :: F4vSettings -> ()
rnf F4vSettings' {Maybe F4vMoovPlacement
moovPlacement :: Maybe F4vMoovPlacement
$sel:moovPlacement:F4vSettings' :: F4vSettings -> Maybe F4vMoovPlacement
..} = forall a. NFData a => a -> ()
Prelude.rnf Maybe F4vMoovPlacement
moovPlacement

instance Data.ToJSON F4vSettings where
  toJSON :: F4vSettings -> Value
toJSON F4vSettings' {Maybe F4vMoovPlacement
moovPlacement :: Maybe F4vMoovPlacement
$sel:moovPlacement:F4vSettings' :: F4vSettings -> Maybe F4vMoovPlacement
..} =
    [Pair] -> Value
Data.object
      ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Key
"moovPlacement" 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 F4vMoovPlacement
moovPlacement
          ]
      )