{-# 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.MotionGraphicsConfiguration
-- 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.MediaLive.Types.MotionGraphicsConfiguration where

import qualified Amazonka.Core as Core
import qualified Amazonka.Lens as Lens
import Amazonka.MediaLive.Types.MotionGraphicsInsertion
import Amazonka.MediaLive.Types.MotionGraphicsSettings
import qualified Amazonka.Prelude as Prelude

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

-- |
-- Create a value of 'MotionGraphicsConfiguration' 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:
--
-- 'motionGraphicsInsertion', 'motionGraphicsConfiguration_motionGraphicsInsertion' - Undocumented member.
--
-- 'motionGraphicsSettings', 'motionGraphicsConfiguration_motionGraphicsSettings' - Motion Graphics Settings
newMotionGraphicsConfiguration ::
  -- | 'motionGraphicsSettings'
  MotionGraphicsSettings ->
  MotionGraphicsConfiguration
newMotionGraphicsConfiguration :: MotionGraphicsSettings -> MotionGraphicsConfiguration
newMotionGraphicsConfiguration
  MotionGraphicsSettings
pMotionGraphicsSettings_ =
    MotionGraphicsConfiguration' :: Maybe MotionGraphicsInsertion
-> MotionGraphicsSettings -> MotionGraphicsConfiguration
MotionGraphicsConfiguration'
      { $sel:motionGraphicsInsertion:MotionGraphicsConfiguration' :: Maybe MotionGraphicsInsertion
motionGraphicsInsertion =
          Maybe MotionGraphicsInsertion
forall a. Maybe a
Prelude.Nothing,
        $sel:motionGraphicsSettings:MotionGraphicsConfiguration' :: MotionGraphicsSettings
motionGraphicsSettings =
          MotionGraphicsSettings
pMotionGraphicsSettings_
      }

-- | Undocumented member.
motionGraphicsConfiguration_motionGraphicsInsertion :: Lens.Lens' MotionGraphicsConfiguration (Prelude.Maybe MotionGraphicsInsertion)
motionGraphicsConfiguration_motionGraphicsInsertion :: (Maybe MotionGraphicsInsertion
 -> f (Maybe MotionGraphicsInsertion))
-> MotionGraphicsConfiguration -> f MotionGraphicsConfiguration
motionGraphicsConfiguration_motionGraphicsInsertion = (MotionGraphicsConfiguration -> Maybe MotionGraphicsInsertion)
-> (MotionGraphicsConfiguration
    -> Maybe MotionGraphicsInsertion -> MotionGraphicsConfiguration)
-> Lens
     MotionGraphicsConfiguration
     MotionGraphicsConfiguration
     (Maybe MotionGraphicsInsertion)
     (Maybe MotionGraphicsInsertion)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionGraphicsConfiguration' {Maybe MotionGraphicsInsertion
motionGraphicsInsertion :: Maybe MotionGraphicsInsertion
$sel:motionGraphicsInsertion:MotionGraphicsConfiguration' :: MotionGraphicsConfiguration -> Maybe MotionGraphicsInsertion
motionGraphicsInsertion} -> Maybe MotionGraphicsInsertion
motionGraphicsInsertion) (\s :: MotionGraphicsConfiguration
s@MotionGraphicsConfiguration' {} Maybe MotionGraphicsInsertion
a -> MotionGraphicsConfiguration
s {$sel:motionGraphicsInsertion:MotionGraphicsConfiguration' :: Maybe MotionGraphicsInsertion
motionGraphicsInsertion = Maybe MotionGraphicsInsertion
a} :: MotionGraphicsConfiguration)

-- | Motion Graphics Settings
motionGraphicsConfiguration_motionGraphicsSettings :: Lens.Lens' MotionGraphicsConfiguration MotionGraphicsSettings
motionGraphicsConfiguration_motionGraphicsSettings :: (MotionGraphicsSettings -> f MotionGraphicsSettings)
-> MotionGraphicsConfiguration -> f MotionGraphicsConfiguration
motionGraphicsConfiguration_motionGraphicsSettings = (MotionGraphicsConfiguration -> MotionGraphicsSettings)
-> (MotionGraphicsConfiguration
    -> MotionGraphicsSettings -> MotionGraphicsConfiguration)
-> Lens
     MotionGraphicsConfiguration
     MotionGraphicsConfiguration
     MotionGraphicsSettings
     MotionGraphicsSettings
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionGraphicsConfiguration' {MotionGraphicsSettings
motionGraphicsSettings :: MotionGraphicsSettings
$sel:motionGraphicsSettings:MotionGraphicsConfiguration' :: MotionGraphicsConfiguration -> MotionGraphicsSettings
motionGraphicsSettings} -> MotionGraphicsSettings
motionGraphicsSettings) (\s :: MotionGraphicsConfiguration
s@MotionGraphicsConfiguration' {} MotionGraphicsSettings
a -> MotionGraphicsConfiguration
s {$sel:motionGraphicsSettings:MotionGraphicsConfiguration' :: MotionGraphicsSettings
motionGraphicsSettings = MotionGraphicsSettings
a} :: MotionGraphicsConfiguration)

instance Core.FromJSON MotionGraphicsConfiguration where
  parseJSON :: Value -> Parser MotionGraphicsConfiguration
parseJSON =
    String
-> (Object -> Parser MotionGraphicsConfiguration)
-> Value
-> Parser MotionGraphicsConfiguration
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MotionGraphicsConfiguration"
      ( \Object
x ->
          Maybe MotionGraphicsInsertion
-> MotionGraphicsSettings -> MotionGraphicsConfiguration
MotionGraphicsConfiguration'
            (Maybe MotionGraphicsInsertion
 -> MotionGraphicsSettings -> MotionGraphicsConfiguration)
-> Parser (Maybe MotionGraphicsInsertion)
-> Parser (MotionGraphicsSettings -> MotionGraphicsConfiguration)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe MotionGraphicsInsertion)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"motionGraphicsInsertion")
            Parser (MotionGraphicsSettings -> MotionGraphicsConfiguration)
-> Parser MotionGraphicsSettings
-> Parser MotionGraphicsConfiguration
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser MotionGraphicsSettings
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"motionGraphicsSettings")
      )

instance Prelude.Hashable MotionGraphicsConfiguration

instance Prelude.NFData MotionGraphicsConfiguration

instance Core.ToJSON MotionGraphicsConfiguration where
  toJSON :: MotionGraphicsConfiguration -> Value
toJSON MotionGraphicsConfiguration' {Maybe MotionGraphicsInsertion
MotionGraphicsSettings
motionGraphicsSettings :: MotionGraphicsSettings
motionGraphicsInsertion :: Maybe MotionGraphicsInsertion
$sel:motionGraphicsSettings:MotionGraphicsConfiguration' :: MotionGraphicsConfiguration -> MotionGraphicsSettings
$sel:motionGraphicsInsertion:MotionGraphicsConfiguration' :: MotionGraphicsConfiguration -> Maybe MotionGraphicsInsertion
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [ (Text
"motionGraphicsInsertion" Text -> MotionGraphicsInsertion -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=)
              (MotionGraphicsInsertion -> Pair)
-> Maybe MotionGraphicsInsertion -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe MotionGraphicsInsertion
motionGraphicsInsertion,
            Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just
              ( Text
"motionGraphicsSettings"
                  Text -> MotionGraphicsSettings -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= MotionGraphicsSettings
motionGraphicsSettings
              )
          ]
      )