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

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

-- | Start time for the action.
--
-- /See:/ 'newFixedModeScheduleActionStartSettings' smart constructor.
data FixedModeScheduleActionStartSettings = FixedModeScheduleActionStartSettings'
  { -- | Start time for the action to start in the channel. (Not the time for the
    -- action to be added to the schedule: actions are always added to the
    -- schedule immediately.) UTC format: yyyy-mm-ddThh:mm:ss.nnnZ. All the
    -- letters are digits (for example, mm might be 01) except for the two
    -- constants \"T\" for time and \"Z\" for \"UTC format\".
    FixedModeScheduleActionStartSettings -> Text
time :: Prelude.Text
  }
  deriving (FixedModeScheduleActionStartSettings
-> FixedModeScheduleActionStartSettings -> Bool
(FixedModeScheduleActionStartSettings
 -> FixedModeScheduleActionStartSettings -> Bool)
-> (FixedModeScheduleActionStartSettings
    -> FixedModeScheduleActionStartSettings -> Bool)
-> Eq FixedModeScheduleActionStartSettings
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: FixedModeScheduleActionStartSettings
-> FixedModeScheduleActionStartSettings -> Bool
$c/= :: FixedModeScheduleActionStartSettings
-> FixedModeScheduleActionStartSettings -> Bool
== :: FixedModeScheduleActionStartSettings
-> FixedModeScheduleActionStartSettings -> Bool
$c== :: FixedModeScheduleActionStartSettings
-> FixedModeScheduleActionStartSettings -> Bool
Prelude.Eq, ReadPrec [FixedModeScheduleActionStartSettings]
ReadPrec FixedModeScheduleActionStartSettings
Int -> ReadS FixedModeScheduleActionStartSettings
ReadS [FixedModeScheduleActionStartSettings]
(Int -> ReadS FixedModeScheduleActionStartSettings)
-> ReadS [FixedModeScheduleActionStartSettings]
-> ReadPrec FixedModeScheduleActionStartSettings
-> ReadPrec [FixedModeScheduleActionStartSettings]
-> Read FixedModeScheduleActionStartSettings
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
readListPrec :: ReadPrec [FixedModeScheduleActionStartSettings]
$creadListPrec :: ReadPrec [FixedModeScheduleActionStartSettings]
readPrec :: ReadPrec FixedModeScheduleActionStartSettings
$creadPrec :: ReadPrec FixedModeScheduleActionStartSettings
readList :: ReadS [FixedModeScheduleActionStartSettings]
$creadList :: ReadS [FixedModeScheduleActionStartSettings]
readsPrec :: Int -> ReadS FixedModeScheduleActionStartSettings
$creadsPrec :: Int -> ReadS FixedModeScheduleActionStartSettings
Prelude.Read, Int -> FixedModeScheduleActionStartSettings -> ShowS
[FixedModeScheduleActionStartSettings] -> ShowS
FixedModeScheduleActionStartSettings -> String
(Int -> FixedModeScheduleActionStartSettings -> ShowS)
-> (FixedModeScheduleActionStartSettings -> String)
-> ([FixedModeScheduleActionStartSettings] -> ShowS)
-> Show FixedModeScheduleActionStartSettings
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [FixedModeScheduleActionStartSettings] -> ShowS
$cshowList :: [FixedModeScheduleActionStartSettings] -> ShowS
show :: FixedModeScheduleActionStartSettings -> String
$cshow :: FixedModeScheduleActionStartSettings -> String
showsPrec :: Int -> FixedModeScheduleActionStartSettings -> ShowS
$cshowsPrec :: Int -> FixedModeScheduleActionStartSettings -> ShowS
Prelude.Show, (forall x.
 FixedModeScheduleActionStartSettings
 -> Rep FixedModeScheduleActionStartSettings x)
-> (forall x.
    Rep FixedModeScheduleActionStartSettings x
    -> FixedModeScheduleActionStartSettings)
-> Generic FixedModeScheduleActionStartSettings
forall x.
Rep FixedModeScheduleActionStartSettings x
-> FixedModeScheduleActionStartSettings
forall x.
FixedModeScheduleActionStartSettings
-> Rep FixedModeScheduleActionStartSettings x
forall a.
(forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
$cto :: forall x.
Rep FixedModeScheduleActionStartSettings x
-> FixedModeScheduleActionStartSettings
$cfrom :: forall x.
FixedModeScheduleActionStartSettings
-> Rep FixedModeScheduleActionStartSettings x
Prelude.Generic)

-- |
-- Create a value of 'FixedModeScheduleActionStartSettings' 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:
--
-- 'time', 'fixedModeScheduleActionStartSettings_time' - Start time for the action to start in the channel. (Not the time for the
-- action to be added to the schedule: actions are always added to the
-- schedule immediately.) UTC format: yyyy-mm-ddThh:mm:ss.nnnZ. All the
-- letters are digits (for example, mm might be 01) except for the two
-- constants \"T\" for time and \"Z\" for \"UTC format\".
newFixedModeScheduleActionStartSettings ::
  -- | 'time'
  Prelude.Text ->
  FixedModeScheduleActionStartSettings
newFixedModeScheduleActionStartSettings :: Text -> FixedModeScheduleActionStartSettings
newFixedModeScheduleActionStartSettings Text
pTime_ =
  FixedModeScheduleActionStartSettings' :: Text -> FixedModeScheduleActionStartSettings
FixedModeScheduleActionStartSettings'
    { $sel:time:FixedModeScheduleActionStartSettings' :: Text
time =
        Text
pTime_
    }

-- | Start time for the action to start in the channel. (Not the time for the
-- action to be added to the schedule: actions are always added to the
-- schedule immediately.) UTC format: yyyy-mm-ddThh:mm:ss.nnnZ. All the
-- letters are digits (for example, mm might be 01) except for the two
-- constants \"T\" for time and \"Z\" for \"UTC format\".
fixedModeScheduleActionStartSettings_time :: Lens.Lens' FixedModeScheduleActionStartSettings Prelude.Text
fixedModeScheduleActionStartSettings_time :: (Text -> f Text)
-> FixedModeScheduleActionStartSettings
-> f FixedModeScheduleActionStartSettings
fixedModeScheduleActionStartSettings_time = (FixedModeScheduleActionStartSettings -> Text)
-> (FixedModeScheduleActionStartSettings
    -> Text -> FixedModeScheduleActionStartSettings)
-> Lens
     FixedModeScheduleActionStartSettings
     FixedModeScheduleActionStartSettings
     Text
     Text
forall s a b t. (s -> a) -> (s -> b -> t) -> Lens s t a b
Lens.lens (\FixedModeScheduleActionStartSettings' {Text
time :: Text
$sel:time:FixedModeScheduleActionStartSettings' :: FixedModeScheduleActionStartSettings -> Text
time} -> Text
time) (\s :: FixedModeScheduleActionStartSettings
s@FixedModeScheduleActionStartSettings' {} Text
a -> FixedModeScheduleActionStartSettings
s {$sel:time:FixedModeScheduleActionStartSettings' :: Text
time = Text
a} :: FixedModeScheduleActionStartSettings)

instance
  Core.FromJSON
    FixedModeScheduleActionStartSettings
  where
  parseJSON :: Value -> Parser FixedModeScheduleActionStartSettings
parseJSON =
    String
-> (Object -> Parser FixedModeScheduleActionStartSettings)
-> Value
-> Parser FixedModeScheduleActionStartSettings
forall a. String -> (Object -> Parser a) -> Value -> Parser a
Core.withObject
      String
"FixedModeScheduleActionStartSettings"
      ( \Object
x ->
          Text -> FixedModeScheduleActionStartSettings
FixedModeScheduleActionStartSettings'
            (Text -> FixedModeScheduleActionStartSettings)
-> Parser Text -> Parser FixedModeScheduleActionStartSettings
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x Object -> Text -> Parser Text
forall a. FromJSON a => Object -> Text -> Parser a
Core..: Text
"time")
      )

instance
  Prelude.Hashable
    FixedModeScheduleActionStartSettings

instance
  Prelude.NFData
    FixedModeScheduleActionStartSettings

instance
  Core.ToJSON
    FixedModeScheduleActionStartSettings
  where
  toJSON :: FixedModeScheduleActionStartSettings -> Value
toJSON FixedModeScheduleActionStartSettings' {Text
time :: Text
$sel:time:FixedModeScheduleActionStartSettings' :: FixedModeScheduleActionStartSettings -> Text
..} =
    [Pair] -> Value
Core.object
      ( [Maybe Pair] -> [Pair]
forall a. [Maybe a] -> [a]
Prelude.catMaybes
          [Pair -> Maybe Pair
forall a. a -> Maybe a
Prelude.Just (Text
"time" Text -> Text -> Pair
forall kv v. (KeyValue kv, ToJSON v) => Text -> v -> kv
Core..= Text
time)]
      )