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

import qualified Amazonka.Core as Core
import qualified Amazonka.Core.Lens.Internal as Lens
import qualified Amazonka.Data as Data
import Amazonka.MediaLive.Types.HtmlMotionGraphicsSettings
import qualified Amazonka.Prelude as Prelude

-- | Motion Graphics Settings
--
-- /See:/ 'newMotionGraphicsSettings' smart constructor.
data MotionGraphicsSettings = MotionGraphicsSettings'
  { MotionGraphicsSettings -> Maybe HtmlMotionGraphicsSettings
htmlMotionGraphicsSettings :: Prelude.Maybe HtmlMotionGraphicsSettings
  }
  deriving (MotionGraphicsSettings -> MotionGraphicsSettings -> Bool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MotionGraphicsSettings -> MotionGraphicsSettings -> Bool
$c/= :: MotionGraphicsSettings -> MotionGraphicsSettings -> Bool
== :: MotionGraphicsSettings -> MotionGraphicsSettings -> Bool
$c== :: MotionGraphicsSettings -> MotionGraphicsSettings -> Bool
Prelude.Eq, ReadPrec [MotionGraphicsSettings]
ReadPrec MotionGraphicsSettings
Int -> ReadS MotionGraphicsSettings
ReadS [MotionGraphicsSettings]
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MotionGraphicsSettings]
$creadListPrec :: ReadPrec [MotionGraphicsSettings]
readPrec :: ReadPrec MotionGraphicsSettings
$creadPrec :: ReadPrec MotionGraphicsSettings
readList :: ReadS [MotionGraphicsSettings]
$creadList :: ReadS [MotionGraphicsSettings]
readsPrec :: Int -> ReadS MotionGraphicsSettings
$creadsPrec :: Int -> ReadS MotionGraphicsSettings
Prelude.Read, Int -> MotionGraphicsSettings -> ShowS
[MotionGraphicsSettings] -> ShowS
MotionGraphicsSettings -> String
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MotionGraphicsSettings] -> ShowS
$cshowList :: [MotionGraphicsSettings] -> ShowS
show :: MotionGraphicsSettings -> String
$cshow :: MotionGraphicsSettings -> String
showsPrec :: Int -> MotionGraphicsSettings -> ShowS
$cshowsPrec :: Int -> MotionGraphicsSettings -> ShowS
Prelude.Show, forall x. Rep MotionGraphicsSettings x -> MotionGraphicsSettings
forall x. MotionGraphicsSettings -> Rep MotionGraphicsSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x. Rep MotionGraphicsSettings x -> MotionGraphicsSettings
$cfrom :: forall x. MotionGraphicsSettings -> Rep MotionGraphicsSettings x
Prelude.Generic)

-- |
-- Create a value of 'MotionGraphicsSettings' 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:
--
-- 'htmlMotionGraphicsSettings', 'motionGraphicsSettings_htmlMotionGraphicsSettings' - Undocumented member.
newMotionGraphicsSettings ::
  MotionGraphicsSettings
newMotionGraphicsSettings :: MotionGraphicsSettings
newMotionGraphicsSettings =
  MotionGraphicsSettings'
    { $sel:htmlMotionGraphicsSettings:MotionGraphicsSettings' :: Maybe HtmlMotionGraphicsSettings
htmlMotionGraphicsSettings =
        forall a. Maybe a
Prelude.Nothing
    }

-- | Undocumented member.
motionGraphicsSettings_htmlMotionGraphicsSettings :: Lens.Lens' MotionGraphicsSettings (Prelude.Maybe HtmlMotionGraphicsSettings)
motionGraphicsSettings_htmlMotionGraphicsSettings :: Lens' MotionGraphicsSettings (Maybe HtmlMotionGraphicsSettings)
motionGraphicsSettings_htmlMotionGraphicsSettings = forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionGraphicsSettings' {Maybe HtmlMotionGraphicsSettings
htmlMotionGraphicsSettings :: Maybe HtmlMotionGraphicsSettings
$sel:htmlMotionGraphicsSettings:MotionGraphicsSettings' :: MotionGraphicsSettings -> Maybe HtmlMotionGraphicsSettings
htmlMotionGraphicsSettings} -> Maybe HtmlMotionGraphicsSettings
htmlMotionGraphicsSettings) (\s :: MotionGraphicsSettings
s@MotionGraphicsSettings' {} Maybe HtmlMotionGraphicsSettings
a -> MotionGraphicsSettings
s {$sel:htmlMotionGraphicsSettings:MotionGraphicsSettings' :: Maybe HtmlMotionGraphicsSettings
htmlMotionGraphicsSettings = Maybe HtmlMotionGraphicsSettings
a} :: MotionGraphicsSettings)

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

instance Prelude.Hashable MotionGraphicsSettings where
  hashWithSalt :: Int -> MotionGraphicsSettings -> Int
hashWithSalt Int
_salt MotionGraphicsSettings' {Maybe HtmlMotionGraphicsSettings
htmlMotionGraphicsSettings :: Maybe HtmlMotionGraphicsSettings
$sel:htmlMotionGraphicsSettings:MotionGraphicsSettings' :: MotionGraphicsSettings -> Maybe HtmlMotionGraphicsSettings
..} =
    Int
_salt
      forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe HtmlMotionGraphicsSettings
htmlMotionGraphicsSettings

instance Prelude.NFData MotionGraphicsSettings where
  rnf :: MotionGraphicsSettings -> ()
rnf MotionGraphicsSettings' {Maybe HtmlMotionGraphicsSettings
htmlMotionGraphicsSettings :: Maybe HtmlMotionGraphicsSettings
$sel:htmlMotionGraphicsSettings:MotionGraphicsSettings' :: MotionGraphicsSettings -> Maybe HtmlMotionGraphicsSettings
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe HtmlMotionGraphicsSettings
htmlMotionGraphicsSettings

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