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

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

-- | Settings to specify the rendering of motion graphics into the video
-- stream.
--
-- /See:/ 'newMotionGraphicsActivateScheduleActionSettings' smart constructor.
data MotionGraphicsActivateScheduleActionSettings = MotionGraphicsActivateScheduleActionSettings'
  { -- | URI of the HTML5 content to be rendered into the live stream.
    MotionGraphicsActivateScheduleActionSettings -> Maybe Text
url :: Prelude.Maybe Prelude.Text,
    -- | Documentation update needed
    MotionGraphicsActivateScheduleActionSettings -> Maybe Text
username :: Prelude.Maybe Prelude.Text,
    -- | Key used to extract the password from EC2 Parameter store
    MotionGraphicsActivateScheduleActionSettings -> Maybe Text
passwordParam :: Prelude.Maybe Prelude.Text,
    -- | Duration (in milliseconds) that motion graphics should render on to the
    -- video stream. Leaving out this property or setting to 0 will result in
    -- rendering continuing until a deactivate action is processed.
    MotionGraphicsActivateScheduleActionSettings -> Maybe Natural
duration :: Prelude.Maybe Prelude.Natural
  }
  deriving (MotionGraphicsActivateScheduleActionSettings
-> MotionGraphicsActivateScheduleActionSettings -> Bool
(MotionGraphicsActivateScheduleActionSettings
 -> MotionGraphicsActivateScheduleActionSettings -> Bool)
-> (MotionGraphicsActivateScheduleActionSettings
    -> MotionGraphicsActivateScheduleActionSettings -> Bool)
-> Eq MotionGraphicsActivateScheduleActionSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: MotionGraphicsActivateScheduleActionSettings
-> MotionGraphicsActivateScheduleActionSettings -> Bool
$c/= :: MotionGraphicsActivateScheduleActionSettings
-> MotionGraphicsActivateScheduleActionSettings -> Bool
== :: MotionGraphicsActivateScheduleActionSettings
-> MotionGraphicsActivateScheduleActionSettings -> Bool
$c== :: MotionGraphicsActivateScheduleActionSettings
-> MotionGraphicsActivateScheduleActionSettings -> Bool
Prelude.Eq, ReadPrec [MotionGraphicsActivateScheduleActionSettings]
ReadPrec MotionGraphicsActivateScheduleActionSettings
Int -> ReadS MotionGraphicsActivateScheduleActionSettings
ReadS [MotionGraphicsActivateScheduleActionSettings]
(Int -> ReadS MotionGraphicsActivateScheduleActionSettings)
-> ReadS [MotionGraphicsActivateScheduleActionSettings]
-> ReadPrec MotionGraphicsActivateScheduleActionSettings
-> ReadPrec [MotionGraphicsActivateScheduleActionSettings]
-> Read MotionGraphicsActivateScheduleActionSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [MotionGraphicsActivateScheduleActionSettings]
$creadListPrec :: ReadPrec [MotionGraphicsActivateScheduleActionSettings]
readPrec :: ReadPrec MotionGraphicsActivateScheduleActionSettings
$creadPrec :: ReadPrec MotionGraphicsActivateScheduleActionSettings
readList :: ReadS [MotionGraphicsActivateScheduleActionSettings]
$creadList :: ReadS [MotionGraphicsActivateScheduleActionSettings]
readsPrec :: Int -> ReadS MotionGraphicsActivateScheduleActionSettings
$creadsPrec :: Int -> ReadS MotionGraphicsActivateScheduleActionSettings
Prelude.Read, Int -> MotionGraphicsActivateScheduleActionSettings -> ShowS
[MotionGraphicsActivateScheduleActionSettings] -> ShowS
MotionGraphicsActivateScheduleActionSettings -> String
(Int -> MotionGraphicsActivateScheduleActionSettings -> ShowS)
-> (MotionGraphicsActivateScheduleActionSettings -> String)
-> ([MotionGraphicsActivateScheduleActionSettings] -> ShowS)
-> Show MotionGraphicsActivateScheduleActionSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [MotionGraphicsActivateScheduleActionSettings] -> ShowS
$cshowList :: [MotionGraphicsActivateScheduleActionSettings] -> ShowS
show :: MotionGraphicsActivateScheduleActionSettings -> String
$cshow :: MotionGraphicsActivateScheduleActionSettings -> String
showsPrec :: Int -> MotionGraphicsActivateScheduleActionSettings -> ShowS
$cshowsPrec :: Int -> MotionGraphicsActivateScheduleActionSettings -> ShowS
Prelude.Show, (forall x.
 MotionGraphicsActivateScheduleActionSettings
 -> Rep MotionGraphicsActivateScheduleActionSettings x)
-> (forall x.
    Rep MotionGraphicsActivateScheduleActionSettings x
    -> MotionGraphicsActivateScheduleActionSettings)
-> Generic MotionGraphicsActivateScheduleActionSettings
forall x.
Rep MotionGraphicsActivateScheduleActionSettings x
-> MotionGraphicsActivateScheduleActionSettings
forall x.
MotionGraphicsActivateScheduleActionSettings
-> Rep MotionGraphicsActivateScheduleActionSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep MotionGraphicsActivateScheduleActionSettings x
-> MotionGraphicsActivateScheduleActionSettings
$cfrom :: forall x.
MotionGraphicsActivateScheduleActionSettings
-> Rep MotionGraphicsActivateScheduleActionSettings x
Prelude.Generic)

-- |
-- Create a value of 'MotionGraphicsActivateScheduleActionSettings' 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:
--
-- 'url', 'motionGraphicsActivateScheduleActionSettings_url' - URI of the HTML5 content to be rendered into the live stream.
--
-- 'username', 'motionGraphicsActivateScheduleActionSettings_username' - Documentation update needed
--
-- 'passwordParam', 'motionGraphicsActivateScheduleActionSettings_passwordParam' - Key used to extract the password from EC2 Parameter store
--
-- 'duration', 'motionGraphicsActivateScheduleActionSettings_duration' - Duration (in milliseconds) that motion graphics should render on to the
-- video stream. Leaving out this property or setting to 0 will result in
-- rendering continuing until a deactivate action is processed.
newMotionGraphicsActivateScheduleActionSettings ::
  MotionGraphicsActivateScheduleActionSettings
newMotionGraphicsActivateScheduleActionSettings :: MotionGraphicsActivateScheduleActionSettings
newMotionGraphicsActivateScheduleActionSettings =
  MotionGraphicsActivateScheduleActionSettings' :: Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> MotionGraphicsActivateScheduleActionSettings
MotionGraphicsActivateScheduleActionSettings'
    { $sel:url:MotionGraphicsActivateScheduleActionSettings' :: Maybe Text
url =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:username:MotionGraphicsActivateScheduleActionSettings' :: Maybe Text
username = Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:passwordParam:MotionGraphicsActivateScheduleActionSettings' :: Maybe Text
passwordParam =
        Maybe Text
forall a. Maybe a
Prelude.Nothing,
      $sel:duration:MotionGraphicsActivateScheduleActionSettings' :: Maybe Natural
duration = Maybe Natural
forall a. Maybe a
Prelude.Nothing
    }

-- | URI of the HTML5 content to be rendered into the live stream.
motionGraphicsActivateScheduleActionSettings_url :: Lens.Lens' MotionGraphicsActivateScheduleActionSettings (Prelude.Maybe Prelude.Text)
motionGraphicsActivateScheduleActionSettings_url :: (Maybe Text -> f (Maybe Text))
-> MotionGraphicsActivateScheduleActionSettings
-> f MotionGraphicsActivateScheduleActionSettings
motionGraphicsActivateScheduleActionSettings_url = (MotionGraphicsActivateScheduleActionSettings -> Maybe Text)
-> (MotionGraphicsActivateScheduleActionSettings
    -> Maybe Text -> MotionGraphicsActivateScheduleActionSettings)
-> Lens
     MotionGraphicsActivateScheduleActionSettings
     MotionGraphicsActivateScheduleActionSettings
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionGraphicsActivateScheduleActionSettings' {Maybe Text
url :: Maybe Text
$sel:url:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
url} -> Maybe Text
url) (\s :: MotionGraphicsActivateScheduleActionSettings
s@MotionGraphicsActivateScheduleActionSettings' {} Maybe Text
a -> MotionGraphicsActivateScheduleActionSettings
s {$sel:url:MotionGraphicsActivateScheduleActionSettings' :: Maybe Text
url = Maybe Text
a} :: MotionGraphicsActivateScheduleActionSettings)

-- | Documentation update needed
motionGraphicsActivateScheduleActionSettings_username :: Lens.Lens' MotionGraphicsActivateScheduleActionSettings (Prelude.Maybe Prelude.Text)
motionGraphicsActivateScheduleActionSettings_username :: (Maybe Text -> f (Maybe Text))
-> MotionGraphicsActivateScheduleActionSettings
-> f MotionGraphicsActivateScheduleActionSettings
motionGraphicsActivateScheduleActionSettings_username = (MotionGraphicsActivateScheduleActionSettings -> Maybe Text)
-> (MotionGraphicsActivateScheduleActionSettings
    -> Maybe Text -> MotionGraphicsActivateScheduleActionSettings)
-> Lens
     MotionGraphicsActivateScheduleActionSettings
     MotionGraphicsActivateScheduleActionSettings
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionGraphicsActivateScheduleActionSettings' {Maybe Text
username :: Maybe Text
$sel:username:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
username} -> Maybe Text
username) (\s :: MotionGraphicsActivateScheduleActionSettings
s@MotionGraphicsActivateScheduleActionSettings' {} Maybe Text
a -> MotionGraphicsActivateScheduleActionSettings
s {$sel:username:MotionGraphicsActivateScheduleActionSettings' :: Maybe Text
username = Maybe Text
a} :: MotionGraphicsActivateScheduleActionSettings)

-- | Key used to extract the password from EC2 Parameter store
motionGraphicsActivateScheduleActionSettings_passwordParam :: Lens.Lens' MotionGraphicsActivateScheduleActionSettings (Prelude.Maybe Prelude.Text)
motionGraphicsActivateScheduleActionSettings_passwordParam :: (Maybe Text -> f (Maybe Text))
-> MotionGraphicsActivateScheduleActionSettings
-> f MotionGraphicsActivateScheduleActionSettings
motionGraphicsActivateScheduleActionSettings_passwordParam = (MotionGraphicsActivateScheduleActionSettings -> Maybe Text)
-> (MotionGraphicsActivateScheduleActionSettings
    -> Maybe Text -> MotionGraphicsActivateScheduleActionSettings)
-> Lens
     MotionGraphicsActivateScheduleActionSettings
     MotionGraphicsActivateScheduleActionSettings
     (Maybe Text)
     (Maybe Text)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionGraphicsActivateScheduleActionSettings' {Maybe Text
passwordParam :: Maybe Text
$sel:passwordParam:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
passwordParam} -> Maybe Text
passwordParam) (\s :: MotionGraphicsActivateScheduleActionSettings
s@MotionGraphicsActivateScheduleActionSettings' {} Maybe Text
a -> MotionGraphicsActivateScheduleActionSettings
s {$sel:passwordParam:MotionGraphicsActivateScheduleActionSettings' :: Maybe Text
passwordParam = Maybe Text
a} :: MotionGraphicsActivateScheduleActionSettings)

-- | Duration (in milliseconds) that motion graphics should render on to the
-- video stream. Leaving out this property or setting to 0 will result in
-- rendering continuing until a deactivate action is processed.
motionGraphicsActivateScheduleActionSettings_duration :: Lens.Lens' MotionGraphicsActivateScheduleActionSettings (Prelude.Maybe Prelude.Natural)
motionGraphicsActivateScheduleActionSettings_duration :: (Maybe Natural -> f (Maybe Natural))
-> MotionGraphicsActivateScheduleActionSettings
-> f MotionGraphicsActivateScheduleActionSettings
motionGraphicsActivateScheduleActionSettings_duration = (MotionGraphicsActivateScheduleActionSettings -> Maybe Natural)
-> (MotionGraphicsActivateScheduleActionSettings
    -> Maybe Natural -> MotionGraphicsActivateScheduleActionSettings)
-> Lens
     MotionGraphicsActivateScheduleActionSettings
     MotionGraphicsActivateScheduleActionSettings
     (Maybe Natural)
     (Maybe Natural)
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\MotionGraphicsActivateScheduleActionSettings' {Maybe Natural
duration :: Maybe Natural
$sel:duration:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Natural
duration} -> Maybe Natural
duration) (\s :: MotionGraphicsActivateScheduleActionSettings
s@MotionGraphicsActivateScheduleActionSettings' {} Maybe Natural
a -> MotionGraphicsActivateScheduleActionSettings
s {$sel:duration:MotionGraphicsActivateScheduleActionSettings' :: Maybe Natural
duration = Maybe Natural
a} :: MotionGraphicsActivateScheduleActionSettings)

instance
  Core.FromJSON
    MotionGraphicsActivateScheduleActionSettings
  where
  parseJSON :: Value -> Parser MotionGraphicsActivateScheduleActionSettings
parseJSON =
    String
-> (Object -> Parser MotionGraphicsActivateScheduleActionSettings)
-> Value
-> Parser MotionGraphicsActivateScheduleActionSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"MotionGraphicsActivateScheduleActionSettings"
      ( \Object
x ->
          Maybe Text
-> Maybe Text
-> Maybe Text
-> Maybe Natural
-> MotionGraphicsActivateScheduleActionSettings
MotionGraphicsActivateScheduleActionSettings'
            (Maybe Text
 -> Maybe Text
 -> Maybe Text
 -> Maybe Natural
 -> MotionGraphicsActivateScheduleActionSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Text
      -> Maybe Natural
      -> MotionGraphicsActivateScheduleActionSettings)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"url")
              Parser
  (Maybe Text
   -> Maybe Text
   -> Maybe Natural
   -> MotionGraphicsActivateScheduleActionSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Text
      -> Maybe Natural -> MotionGraphicsActivateScheduleActionSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"username")
              Parser
  (Maybe Text
   -> Maybe Natural -> MotionGraphicsActivateScheduleActionSettings)
-> Parser (Maybe Text)
-> Parser
     (Maybe Natural -> MotionGraphicsActivateScheduleActionSettings)
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Text)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"passwordParam")
              Parser
  (Maybe Natural -> MotionGraphicsActivateScheduleActionSettings)
-> Parser (Maybe Natural)
-> Parser MotionGraphicsActivateScheduleActionSettings
forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x Object -> Text -> Parser (Maybe Natural)
forall a. FromJSON a => Object -> Text -> Parser (Maybe a)
Core..:? Text
"duration")
      )

instance
  Prelude.Hashable
    MotionGraphicsActivateScheduleActionSettings

instance
  Prelude.NFData
    MotionGraphicsActivateScheduleActionSettings

instance
  Core.ToJSON
    MotionGraphicsActivateScheduleActionSettings
  where
  toJSON :: MotionGraphicsActivateScheduleActionSettings -> Value
toJSON
    MotionGraphicsActivateScheduleActionSettings' {Maybe Natural
Maybe Text
duration :: Maybe Natural
passwordParam :: Maybe Text
username :: Maybe Text
url :: Maybe Text
$sel:duration:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Natural
$sel:passwordParam:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
$sel:username:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
$sel:url:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
..} =
      [Pair] -> Value
Core.object
        ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Text
"url" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
url,
              (Text
"username" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
username,
              (Text
"passwordParam" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Text -> Pair) -> Maybe Text -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Text
passwordParam,
              (Text
"duration" Text -> Natural -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..=) (Natural -> Pair) -> Maybe Natural -> Maybe Pair
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> Maybe Natural
duration
            ]
        )