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

-- | 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
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]
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
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.
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'
    { $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 :: Lens' FixedModeScheduleActionStartSettings Text
fixedModeScheduleActionStartSettings_time = 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
  Data.FromJSON
    FixedModeScheduleActionStartSettings
  where
  parseJSON :: Value -> Parser FixedModeScheduleActionStartSettings
parseJSON =
    forall a. String -> (Object -> Parser a) -> Value -> Parser a
Data.withObject
      String
"FixedModeScheduleActionStartSettings"
      ( \Object
x ->
          Text -> FixedModeScheduleActionStartSettings
FixedModeScheduleActionStartSettings'
            forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
Prelude.<$> (Object
x forall a. FromJSON a => Object -> Key -> Parser a
Data..: Key
"time")
      )

instance
  Prelude.Hashable
    FixedModeScheduleActionStartSettings
  where
  hashWithSalt :: Int -> FixedModeScheduleActionStartSettings -> Int
hashWithSalt
    Int
_salt
    FixedModeScheduleActionStartSettings' {Text
time :: Text
$sel:time:FixedModeScheduleActionStartSettings' :: FixedModeScheduleActionStartSettings -> Text
..} =
      Int
_salt forall a. Hashable a => Int -> a -> Int
`Prelude.hashWithSalt` Text
time

instance
  Prelude.NFData
    FixedModeScheduleActionStartSettings
  where
  rnf :: FixedModeScheduleActionStartSettings -> ()
rnf FixedModeScheduleActionStartSettings' {Text
time :: Text
$sel:time:FixedModeScheduleActionStartSettings' :: FixedModeScheduleActionStartSettings -> Text
..} =
    forall a. NFData a => a -> ()
Prelude.rnf Text
time

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