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

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

-- | Frame Capture Output Settings
--
-- /See:/ 'newFrameCaptureOutputSettings' smart constructor.
data FrameCaptureOutputSettings = FrameCaptureOutputSettings'
  { -- | Required if the output group contains more than one output. This
    -- modifier forms part of the output file name.
    FrameCaptureOutputSettings -> Maybe Text
nameModifier :: Prelude.Maybe Prelude.Text
  }
  deriving (FrameCaptureOutputSettings -> FrameCaptureOutputSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FrameCaptureOutputSettings -> FrameCaptureOutputSettings -> Bool
$c/= :: FrameCaptureOutputSettings -> FrameCaptureOutputSettings -> Bool
== :: FrameCaptureOutputSettings -> FrameCaptureOutputSettings -> Bool
$c== :: FrameCaptureOutputSettings -> FrameCaptureOutputSettings -> Bool
Prelude.Eq, ReadPrec [FrameCaptureOutputSettings]
ReadPrec FrameCaptureOutputSettings
Int -> ReadS FrameCaptureOutputSettings
ReadS [FrameCaptureOutputSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FrameCaptureOutputSettings]
$creadListPrec :: ReadPrec [FrameCaptureOutputSettings]
readPrec :: ReadPrec FrameCaptureOutputSettings
$creadPrec :: ReadPrec FrameCaptureOutputSettings
readList :: ReadS [FrameCaptureOutputSettings]
$creadList :: ReadS [FrameCaptureOutputSettings]
readsPrec :: Int -> ReadS FrameCaptureOutputSettings
$creadsPrec :: Int -> ReadS FrameCaptureOutputSettings
Prelude.Read, Int -> FrameCaptureOutputSettings -> ShowS
[FrameCaptureOutputSettings] -> ShowS
FrameCaptureOutputSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FrameCaptureOutputSettings] -> ShowS
$cshowList :: [FrameCaptureOutputSettings] -> ShowS
show :: FrameCaptureOutputSettings -> String
$cshow :: FrameCaptureOutputSettings -> String
showsPrec :: Int -> FrameCaptureOutputSettings -> ShowS
$cshowsPrec :: Int -> FrameCaptureOutputSettings -> ShowS
Prelude.Show, forall x.
Rep FrameCaptureOutputSettings x -> FrameCaptureOutputSettings
forall x.
FrameCaptureOutputSettings -> Rep FrameCaptureOutputSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FrameCaptureOutputSettings x -> FrameCaptureOutputSettings
$cfrom :: forall x.
FrameCaptureOutputSettings -> Rep FrameCaptureOutputSettings x
Prelude.Generic)

-- |
-- Create a value of 'FrameCaptureOutputSettings' 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:
--
-- 'nameModifier', 'frameCaptureOutputSettings_nameModifier' - Required if the output group contains more than one output. This
-- modifier forms part of the output file name.
newFrameCaptureOutputSettings ::
  FrameCaptureOutputSettings
newFrameCaptureOutputSettings :: FrameCaptureOutputSettings
newFrameCaptureOutputSettings =
  FrameCaptureOutputSettings'
    { $sel:nameModifier:FrameCaptureOutputSettings' :: Maybe Text
nameModifier =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Required if the output group contains more than one output. This
-- modifier forms part of the output file name.
frameCaptureOutputSettings_nameModifier :: Lens.Lens' FrameCaptureOutputSettings (Prelude.Maybe Prelude.Text)
frameCaptureOutputSettings_nameModifier :: Lens' FrameCaptureOutputSettings (Maybe Text)
frameCaptureOutputSettings_nameModifier = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FrameCaptureOutputSettings' {Maybe Text
nameModifier :: Maybe Text
$sel:nameModifier:FrameCaptureOutputSettings' :: FrameCaptureOutputSettings -> Maybe Text
nameModifier} -> Maybe Text
nameModifier) (\s :: FrameCaptureOutputSettings
s@FrameCaptureOutputSettings' {} Maybe Text
a -> FrameCaptureOutputSettings
s {$sel:nameModifier:FrameCaptureOutputSettings' :: Maybe Text
nameModifier = Maybe Text
a} :: FrameCaptureOutputSettings)

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

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

instance Prelude.NFData FrameCaptureOutputSettings where
  rnf :: FrameCaptureOutputSettings -> ()
rnf FrameCaptureOutputSettings' {Maybe Text
nameModifier :: Maybe Text
$sel:nameModifier:FrameCaptureOutputSettings' :: FrameCaptureOutputSettings -> Maybe Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
nameModifier

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