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

-- | Settings to specify the rendering of motion graphics into the video
-- stream.
--
-- /See:/ 'newMotionGraphicsActivateScheduleActionSettings' smart constructor.
data MotionGraphicsActivateScheduleActionSettings = 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 -> Maybe Natural
duration :: Prelude.Maybe Prelude.Natural,
    -- | Key used to extract the password from EC2 Parameter store
    MotionGraphicsActivateScheduleActionSettings -> Maybe Text
passwordParam :: Prelude.Maybe Prelude.Text,
    -- | 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
  }
  deriving (MotionGraphicsActivateScheduleActionSettings
-> MotionGraphicsActivateScheduleActionSettings -> Bool
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]
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
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.
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:
--
-- '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.
--
-- 'passwordParam', 'motionGraphicsActivateScheduleActionSettings_passwordParam' - Key used to extract the password from EC2 Parameter store
--
-- 'url', 'motionGraphicsActivateScheduleActionSettings_url' - URI of the HTML5 content to be rendered into the live stream.
--
-- 'username', 'motionGraphicsActivateScheduleActionSettings_username' - Documentation update needed
newMotionGraphicsActivateScheduleActionSettings ::
  MotionGraphicsActivateScheduleActionSettings
newMotionGraphicsActivateScheduleActionSettings :: MotionGraphicsActivateScheduleActionSettings
newMotionGraphicsActivateScheduleActionSettings =
  MotionGraphicsActivateScheduleActionSettings'
    { $sel:duration:MotionGraphicsActivateScheduleActionSettings' :: Maybe Natural
duration =
        forall a. Maybe a
Prelude.Nothing,
      $sel:passwordParam:MotionGraphicsActivateScheduleActionSettings' :: Maybe Text
passwordParam =
        forall a. Maybe a
Prelude.Nothing,
      $sel:url:MotionGraphicsActivateScheduleActionSettings' :: Maybe Text
url = forall a. Maybe a
Prelude.Nothing,
      $sel:username:MotionGraphicsActivateScheduleActionSettings' :: Maybe Text
username = forall a. Maybe a
Prelude.Nothing
    }

-- | 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 :: Lens' MotionGraphicsActivateScheduleActionSettings (Maybe Natural)
motionGraphicsActivateScheduleActionSettings_duration = 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)

-- | Key used to extract the password from EC2 Parameter store
motionGraphicsActivateScheduleActionSettings_passwordParam :: Lens.Lens' MotionGraphicsActivateScheduleActionSettings (Prelude.Maybe Prelude.Text)
motionGraphicsActivateScheduleActionSettings_passwordParam :: Lens' MotionGraphicsActivateScheduleActionSettings (Maybe Text)
motionGraphicsActivateScheduleActionSettings_passwordParam = 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)

-- | URI of the HTML5 content to be rendered into the live stream.
motionGraphicsActivateScheduleActionSettings_url :: Lens.Lens' MotionGraphicsActivateScheduleActionSettings (Prelude.Maybe Prelude.Text)
motionGraphicsActivateScheduleActionSettings_url :: Lens' MotionGraphicsActivateScheduleActionSettings (Maybe Text)
motionGraphicsActivateScheduleActionSettings_url = 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 :: Lens' MotionGraphicsActivateScheduleActionSettings (Maybe Text)
motionGraphicsActivateScheduleActionSettings_username = 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)

instance
  Data.FromJSON
    MotionGraphicsActivateScheduleActionSettings
  where
  parseJSON :: Value -> Parser MotionGraphicsActivateScheduleActionSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"MotionGraphicsActivateScheduleActionSettings"
      ( \Object
x ->
          Maybe Natural
-> Maybe Text
-> Maybe Text
-> Maybe Text
-> MotionGraphicsActivateScheduleActionSettings
MotionGraphicsActivateScheduleActionSettings'
            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
"duration")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"passwordParam")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"url")
            forall (f :: * -> *) a b. Applicative f => f (a -> b) -> f a -> f b
Prelude.<*> (Object
x forall a. FromJSON a => Object -> Key -> Parser (Maybe a)
Data..:? Key
"username")
      )

instance
  Prelude.Hashable
    MotionGraphicsActivateScheduleActionSettings
  where
  hashWithSalt :: Int -> MotionGraphicsActivateScheduleActionSettings -> Int
hashWithSalt
    Int
_salt
    MotionGraphicsActivateScheduleActionSettings' {Maybe Natural
Maybe Text
username :: Maybe Text
url :: Maybe Text
passwordParam :: Maybe Text
duration :: Maybe Natural
$sel:username:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
$sel:url:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
$sel:passwordParam:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
$sel:duration:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Natural
..} =
      Int
_salt
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Natural
duration
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
passwordParam
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
url
        forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Maybe Text
username

instance
  Prelude.NFData
    MotionGraphicsActivateScheduleActionSettings
  where
  rnf :: MotionGraphicsActivateScheduleActionSettings -> ()
rnf MotionGraphicsActivateScheduleActionSettings' {Maybe Natural
Maybe Text
username :: Maybe Text
url :: Maybe Text
passwordParam :: Maybe Text
duration :: Maybe Natural
$sel:username:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
$sel:url:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
$sel:passwordParam:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
$sel:duration:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Natural
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Maybe Natural
duration
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
passwordParam
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
url
      seq :: forall a b. a -> b -> b
`Prelude.seq` forall a. NFData a => a -> ()
Prelude.rnf Maybe Text
username

instance
  Data.ToJSON
    MotionGraphicsActivateScheduleActionSettings
  where
  toJSON :: MotionGraphicsActivateScheduleActionSettings -> Value
toJSON
    MotionGraphicsActivateScheduleActionSettings' {Maybe Natural
Maybe Text
username :: Maybe Text
url :: Maybe Text
passwordParam :: Maybe Text
duration :: Maybe Natural
$sel:username:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
$sel:url:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
$sel:passwordParam:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Text
$sel:duration:MotionGraphicsActivateScheduleActionSettings' :: MotionGraphicsActivateScheduleActionSettings -> Maybe Natural
..} =
      [Pair] -> Value
Data.object
        ( forall a. [Maybe a] -> [a]
Prelude.catMaybes
            [ (Key
"duration" 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 Natural
duration,
              (Key
"passwordParam" 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
passwordParam,
              (Key
"url" 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
url,
              (Key
"username" 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
username
            ]
        )